[Question]
  [
You will be given two arrays of floating-point numbers. Your task is to pair the corresponding elements of the two arrays, and get the maximum of each pair. *However*, if the two corresponding elements are equal, you must take their sum instead.
For example, given the lists `[1, 3, 3.2, 2.3]` and `[3, 1, 3.2, 2.6]`, you must do the following:
* Pair the elements (or zip): `[[1, 3], [3, 1], [3.2, 3.2], [2.3, 2.6]]`.
* Go through each pair and apply the process above: `[3, 3, 6.4, 2.6]`.
---
## Specs
* The arrays / lists will always have equal length. They may however be empty.
* The numbers they contain will always fit your language's capabilities, as long as you do not abuse that. They may be positive, zero or negative, you must handle all types.
* If it helps you reduce your byte count, you *may* also take the length of the lists as input.
## Rules
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.
* [Standard input and output rules](https://codegolf.meta.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/2422#2422) apply. You may take input (and output) in any reasonable format.
* [Default Loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
---
# Test Cases
```
Array_1, Array_2 -> Output
[], [] -> []
[1, 2, 3], [1, 3, 2] -> [2, 3, 3]
[1, 3, 3.2, 2.3], [3, 1, 3.2, 2.6] -> [3, 3, 6.4, 2.6]
[1,2,3,4,5,5,7,8,9,10], [10,9,8,7,6,5,4,3,2,1] -> [10, 9, 8, 7, 6, 10, 7, 8, 9, 10]
[-3.2, -3.2, -2.4, 7, -10.1], [100, -3.2, 2.4, -7, -10.1] -> [100, -6.4, 2.4, 7, -20.2]
```
  
[Answer]
# [Python 2](https://docs.python.org/2/), 45 bytes
A mix of my initial solution and [@ovs'](https://codegolf.stackexchange.com/a/140754/59487).
```
lambda*a:map(lambda x,y:max(x,y)*-~(x==y),*a)
```
[Try it online!](https://tio.run/##PY3LCoMwEEX3/YrZGWUiSbRqBfsjaRYpRRqoD8SFbvrr6RirBCb33jOPcZ3fQ6982zz8x3bPl01s3dmR7QYWXMkujP444V@2NM0aY2Jj3w4TOHA9aK0NgjZb0RJBIWSbJpmRO3MyWUpQpQGTlWdSHF0KM8zxSq/ECm8oRVglSFYUFQRyalEo9wkeFvyrSnOEkoQUqdznxAED4yc0pr7AOLl@BocRv0fYMqfpmNPSxP4H "Python 2 – Try It Online")
# [Python 2](https://docs.python.org/2/), 49 bytes
```
lambda x,y:[max(a,b)*-~(a==b)for a,b in zip(x,y)]
```
[Try it online!](https://tio.run/##PY3NCoMwEITvfYq9NZaNmMSqFeyLpDlEijRQfxAP2kNf3W5ilcAy883sZlimV9/Jtake69u29dPCjEupWzszi3V04V9mq6qOmn4EAuA6@LiBUSkyq4fOI621QdDGDy0QJILymqQid3AyKqZQxiEmKw6S7S2JClO80suxwBuKJJxKSBaEMgpSqkgU2wYPB/5TxilCTkIksdj2kj0MGT9CY8oTDKPrJnB45vczNsxp@sxpYaL1Bw "Python 2 – Try It Online")
# [Python 2](https://docs.python.org/2/), 46 bytes
[@ovs](https://codegolf.stackexchange.com/users/64121/ovs) suggested this method to save 3 bytes.
```
lambda*x:[max(a,b)*-~(a==b)for a,b in zip(*x)]
```
[Try it online!](https://tio.run/##PY3LCoMwEEX3/YrZNcooeVi1gv2RNItIkQbqA3Fhu@iv20msEhjunDMzGd/zc@jl2tb39WW75mHjpdKdXZjFJoqTL7N13UTtMAEBcD183MjiJTKrZ84TrbVB0MYXLRAkgvKZoqLu4NSolKRMg6ZWHCTfpyQqzPBCr8ASryh4OMUploRyEhmNSBTbRhIO/KtMM4SCguCp2Pb4LoNLDmlMdYJxcv0MDs/J7Ywtc5o@c1qYaP0B "Python 2 – Try It Online")
---
# How?
First off, we pair the corresponding elements, by using either `*` or `zip()`. That allows us to do our further golfing by working either with a map or a list comprehension.
The cool trick in this answer is this part: `max(x,y)*-~(x==y)`. **How does that work?** - Well, as most of you already know, Python auto-converts bool values to integers when they are used in arithmetic operations. Hence, `(x==y)` gets evaluated as `1`, if the condition is met. However, if the two values are not equal, it returns `0` instead. Then, the bitwise operation `-~` increments the value returned from the bool by `1`, giving us either `2` or `1`. `max(a,b)` gives the maximum value of the pair and `*` multiplies it by the value returned above (so it gets multiplied by `2` only if they are equal, in which case `max()` returns the value of both).
This is based on the fact that the sum of two equal numbers is in fact either of them doubled, and kind of "abuses" Python's bool class being a subclass of int.
[Answer]
# Kotlin, ~~78~~ ~~75~~ ~~71~~ ~~66~~ ~~65~~ 59 bytes
It's my first attempt, be cool :D
```
a.zip(b).map{(a,b)->when{b>a->b;a>b->a;else->a*2}}.toList()
```
**TIO doesn't work with this solution (and i don't know why), source code for testing below**
```
fun main(args: Array<String>) {
    bestOfTwo(floatArrayOf(), floatArrayOf()).print()
    bestOfTwo(floatArrayOf(0F), floatArrayOf(0F)).print()
    bestOfTwo(floatArrayOf(1F,2F,3F), floatArrayOf(1F,3F,2F)).print()
    bestOfTwo(floatArrayOf(1F,3F,3.2F,2.3F), floatArrayOf(3F,1F,3.2F,2.6F)).print()
    bestOfTwo(floatArrayOf(1F,2F,3F,4F,5F,5F,7F,8F,9F,10F), floatArrayOf(10F,9F,8F,7F,6F,5F,4F,3F,2F,1F)).print()
    bestOfTwo(floatArrayOf(-3.2F,-3.2F,-2.4F,7F,-10.1F), floatArrayOf(100F,-3.2F,2.4F,-7F,-10.1F)).print()
}
fun bestOfTwo(a :FloatArray, b :FloatArray): List<Float> =
    a.zip(b).map{(a,b)->when{b>a->b;a>b->a;else->a*2}}.toList()
fun List<Float>.print() {
    this.forEach { print("$it, ") }; println("")
}
```
**EDIT:**
-3 by replace "a+b[i]" by "a\*2"
-4 by replace "mapIndexed" method by "zip" *(Thanks to @AnonymousReality 
 Swift solution)*
-5 by replace "Math.max" method by when condition
-1 by change when condition order
-6 by change toFloatArray() by toList()
[Answer]
# [Python 3](https://docs.python.org/3/), ~~48~~ ~~46~~ 44 bytes
*-2 bytes thanks to @nwellnhof*
```
lambda*a:map(lambda*x:max(x)*2/len({*x}),*a)
```
[Try it online!](https://tio.run/##PY/dDoIwDIXvfYreuS1l7gdFTfRFcBczSiQBJIQLDOHZZxlKlnTnnK9t0vbTv96NDcXlFipf3x9e@HPtW/YzA5mBDVyYXfVs2CiGiaPwPBTvDjzeoWwgzx3mziEJjWAQ7KxJWnJrTsZKgkZGTFavyeHfZdBiint6GR7xhFrFVYrkkaIDgZRaDOplIokLftXIFCEjoZXUy5z6w8iSFbrzBqDtyqZn23FCGCdIrlS3ku6qfc/oNMxFMf/ccR6@ "Python 3 – Try It Online")
[Answer]
# Jelly, 4 bytes
```
=‘×»
```
[Try it online!](https://tio.run/##y0rNyan8/9/2UcOMw9MP7f7//3@0oY6xjrGekY6RnnHs/2hjHUMozywWAA)
This uses the exact same approach as [my APL answer](https://codegolf.stackexchange.com/a/140820/55550), except Jelly has a builtin for adding one to a number!
[Answer]
# JavaScript (ES6), ~~53~~ ~~49~~ ~~45~~ 43 bytes
```
a=>b=>a.map((x,y)=>(y=b[y])>x?y:y<x?x:x+y)
```
* 4 bytes saved by borrowing a trick from Mr. Xcoder.
* 2 bytes saved thanks to Arnauld.
---
## Try it
```
o.innerText=(f=
a=>b=>a.map((x,y)=>(y=b[y])>x?y:y<x?x:x+y)
)(i.value=[1,3,3.2,2.3])(j.value=[3,1,3.2,2.6]);oninput=_=>o.innerText=f(i.value.split`,`.map(eval))(j.value.split`,`.map(eval))
```
```
<input id=i><input id=j><pre id=o>
```
---
## Explanation
```
a=>b=>
```
Anonymous function taking the 2 arrays as arguments via parameters `a` and `b`, in currying syntax (i.e., call with `f(a)(b)`
```
a.map((x,y)=>                      )
```
Map over the first array, passing each element through a function where `x` is the current element and `y` is the current index.
```
(y=b[y])
```
Get the element at index `y` in the second array and assign that as the new value of `y`.
```
>x?y
```
Check if `y` is greater than `x` and, if so, return `y`.
```
:y<x?x
```
Else, check if `y` is less than `x` and, if so, return `x`
```
:x+y
```
Else, return the sum of `x` and `y`. (Multiplying `x` or `y` by 2 would also work here, for the same number of bytes.)
[Answer]
# Haskell, 34 bytes
```
x!y|x>y=x|x<y=y|1<2=x+y
zipWith(!)
```
[Try it online.](https://tio.run/##VU7BboJAFLzzFSPpAeJCYLGKxjVpkzYxNfHgoQdDIkQMpFasYISGf6ePFSrsbjbvzcybeZGffoXHY1Xlg6LMF4XIy3xeiKK051zkw0I5iN/4/BlnkTbQqzRKrsf9a4jZDNrbD3yGTZTc4OsQC/gwmm@5hqYrPnbtwA4BSvhCBJBH4HzNNtlldYK6/lAV9E@JJIvCyy1Ow670Cer7y3I1g4rhEFraRFOt4p6EIOySga4o3358IpN9IkMO2Hr162y29VrGZuAMjicrh5q@jkvQ6crr3iScm/UUdfY/MO4PO1I8Nkd37uHBmcNG7JnuhLlsymyrzreocgkZEz4iBWd2348UmDK4DBOypWBLVq5EyaMNMOQ6zc/reFIZtmXaMsZqOUkZD66fVcua3RsHbpncq/4A)
[Answer]
# Dyalog APL, 5 bytes
```
⌈×1+=
```
[Try it online!](http://tryapl.org/?a=1%203%203.2%202.3%20%28%u2308%D71+%3D%29%203%201%203.2%202.6&run)
## How?
* `⌈`, element-wise maximum of the arguments
* `×`, element-wise multiply
* `1+=`, 1 added to the element-wise equality of the arguments
This works because if the numbers are unequal, `1+=` will be `1`, which when multiplied by the maximum, is the maximum. When the numbers are equal, `1+=` will return `2`, when that is multiplied by the maximum, we get twice the maximum, or the maximum added to itself.
[Answer]
# [R](https://www.r-project.org/), ~~31~~ 29 bytes
```
function(a,b)pmax(a,b)+a*!a-b
```
`pmax` takes the parallel maximum of the two (or more) arrays (recycling the shorter as needed).
I was looking at [Luis Mendo's comment](https://codegolf.stackexchange.com/questions/140748/get-the-best-of-two-arrays#comment344950_140758) and obviously I realized the approach could work for R as well. That got me to 30 bytes, but then I started playing around with different ways of getting indices instead to improve my original answer, and stumbled upon `!a-b` as `TRUE` where `a==b` and `FALSE` otherwise, equivalent to `a==b`. However, for whatever reason, R doesn't require parentheses around `!a-b` as it does for `a==b`, which saved me two bytes.
As mentioned by [JDL in the comments](https://codegolf.stackexchange.com/questions/140748/get-the-best-of-two-arrays/140768#comment345380_140768), this works because `!` (negation) has lower precedence than the binary operator `-` in R, which is strange.
[Try it online! (new version)](https://tio.run/##K/qfZvs/rTQvuSQzP08jUSdJsyA3sQLM0E7UUkzUTfqfppFXmptalJmsYaCpg2BqcqVpJGsY6hjpGGvqgBjGOkZwQQVjINIz0lEw0gPLArmGcBEzTc3/AA "R – Try It Online")
[Try it online! (original)](https://tio.run/##RYlBCoAgEEX3ncLlTA2SCu08zCgJLrSQhG5v5cLgL95/r7RgW6jZX/HIwOTwTHx3WHgGttZhC5Br2kv0sCL9iFMAD4o0GaQPDOkhhXknNQkte32vGmZDbA8 "R – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
żSṀE?€
```
A dyadic link taking a list of numbers on each side and returning the resulting list.
**[Try it online!](https://tio.run/##y0rNyan8///onuCHOxtc7R81rfn//3@0oY6CMRDpGekoGOkZx/6PBvIM4QJmsQA "Jelly – Try It Online")** or see a [test-suite](https://tio.run/##y0rNyan8///onuCHOxtc7R81rQGyDy/XBzKOTnq4cwaQBqIsENUwR0HXTuFRw9zI//@jo6NjdRSiY2N1uBSiow11FIx0FIxBIkCmMZCHkADyjPWAskZ6YHkg1xAuYgZXZqRjrGOiYwqE5joWOpY6hgZgwwyATAugkBlQwgSoxEjHEKpFF2wElDTSM9FRMAcyDA30DCEaDWCSYDlduGRsLAA "Jelly – Try It Online")\*.
### How?
```
żSṀE?€ - Link: list of numbers L, list of numbers R   e.g. [1,3,3.2,2.3], [3,1,3.2,2.6]
ż      - zip - interleave L & R                       [[1,3],[3,1],[3.2,3.2],[2.3,2.6]]
     € - for each pair:
    ?  - { if:
   E   -   ...condition: equal                          0      0       1         0
 S     -   ...then: sum                                               6.4
  Ṁ    -   ...else: maximum                             3      3                2.6
       - }                                    ... ->   [3     ,3     ,6.4      ,2.6]
```
---
An alternative is [this monadic link](https://tio.run/##y0rNyan8/1/70O5HjXvslfT///8fHW2oo2AMRHpGOgpGesaxOtFAniFcwCw2FgA "Jelly – Try It Online") taking a list of the two lists, also **6 bytes**:
```
+»⁼?"/
```
---
\* I don't think I've ever created a test-suite footer almost three times the byte count of the code before!
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 5 bytes
```
øεMÃO
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8I5zW30PN/v//x8dbaijYAxEekY6CkZ6xrE6CtFAriFcxCw2FgA "05AB1E – Try It Online")
-1 thanks to [Emigna](https://codegolf.stackexchange.com/users/47066/emigna).
[Answer]
# [MATL](https://github.com/lmendo/MATL), 7 bytes
```
X>tG=s*
```
Input is a two-row matrix, where each row is one of the arrays.
[Try it online!](https://tio.run/##y00syfn/P8KuxN22WOv//2hDHQVjINIz0lEw0jO2BnEM4XyzWAA "MATL – Try It Online")
### Explanation
```
X>   % Implicit input. Maximum of each column
t    % Duplicate
G    % Push input
=    % Is equal? Element-wise with broadcast. Gives a two-row matrix
s    % Sum of each column. Gives a row vector containing 1 and 2
*    % Multiply, element-wise. Implicit display
```
[Answer]
# Java 8, ~~80~~ ~~69~~ ~~67~~ ~~66~~ ~~65~~ ~~64~~ 63 bytes
```
(a,b,l)->{for(;l-->0;)if(a[l]>=b[l])b[l]=a[l]*(a[l]>b[l]?1:2);}
```
Modifies the second input-array instead or returning a new float-array to save bytes.
-11 bytes by taking the length as additional integer-input, which is allowed according to the challenge rules.  
-5 bytes thanks to *@OliverGrégoire* (one byte at a time.. xD)  
-1 byte indirectly thanks to [*@Shaggy*'s JS answer](https://codegolf.stackexchange.com/a/140757/52210), by using `a[l]*2` instead of `a[l]+b[l]`.
**Explanation:**
[Try it here.](https://tio.run/##rZFNb4JAEIbv/Io5QjNs@PCjLdGmadJbvXg0HlaEZu26S2CxMYbfbmdFJU1LD40JDLsz78z7ZNjwHfd1kanN@uMotoUuDWwox2ojJHsuS76vEudHIa9VaoRW7EWrqt5m5V@a1/MhcVLJqwreuFAHB0Aok5U5TzOY2SvATos1pG4uNTeLJXCEy3GFVg3SS0jYOBQqw41IYQYKJnB0Oa5Qev70kOvSTaTvT4PEE7nLF3I5nawoejZM7P2uzdr7U/gYeUlztGPpKeqVpKHn2SecLcG6c1MK9W6RvJb0imgXRAAq@7zkDk1ykiiWut/S2KoRAq9VzPeVybZM14YVNN9I5bYLZ0a3ju6pwzvrT@E3xxAhRoh6jKkakaDzj2/tT@YWgUU5WbFR3g8Sd7I474gGN99IgA94j2Mc4RAHGGOEYS9VRPUB6Yakv6e@MOjIwtv/rCBA8C9bGFD0x/SGAQv7FndWXz5tV9d0hR3@i7VxmuMX)
```
(a,b,l)->{          // Method with 2 float-array and integer parameters and no return-type
  for(;l-->0;)      //  Loop over the array
    if(a[l]>=b[l])  //   If the current value in `a` is larger or equal to `b`:
      b[l]=         //   Modify the second input-array:
       a[l]*        //    Use `a` multiplied by:
        (a[l]>b[l]? //     If the current value in `a` is larger than `b`:
          1         //      Multiply by 1
         :          //     Else (`a` is smaller of equal to `b`):
          2)        //      Multiply by 2
                    //  End of loop (implicit / single-line body)
}                   // End of method
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 42 bytes
```
->a,b{a.zip(b).map{|x,y|[x+y,x,y][x<=>y]}}
```
[Try it online!](https://tio.run/##TU7dCoMgFL7fUwi7KXYUf1oZrF7EeVEXg10MYjDIVc/ejqYyBP3@zvl8f0a3P7r7TvsBxmVg3@dUjCV7DdOyzuBWM18cILBmvnW9s9u2T@TBCmOBGFueCe3xPR2aACKBKG8hVMhSQgaq/oKeMpQlC3mkIit1GlMhV7PqUPO0BAUVXPE0oKEFwUMnR6hRqtGoMCJBpE3okRaIBtLgQizjAemg4nhcTcMP4i19L4ao4EwcBTyZwaPZzC0@EP8bhyVn0u4/ "Ruby – Try It Online")
The spaceship operator is great.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 11 bytes
```
m*eSdhnd{dC
```
**[Try it here!](https://pyth.herokuapp.com/?code=m%2aeSdhnd%7BdC&input=%5B1%2C+3%2C+3.2%2C+2.3%5D%2C+%5B3%2C+1%2C+3.2%2C+2.6%5D&debug=0)**
# [Pyth](https://github.com/isaacg1/pyth), 12 bytes
```
m*eSdhqhdedC
```
**[Try it here!](https://pyth.herokuapp.com/?code=m%2aeSdhqhdedC&input=%5B1%2C+3%2C+3.2%2C+2.3%5D%2C+%5B3%2C+1%2C+3.2%2C+2.6%5D&debug=0)**
**or**
```
m*eSdh!tl{dC
```
**[Try it here!](https://pyth.herokuapp.com/?code=m%2aeSdh%21tl%7BdC&input=%5B1%2C+3%2C+3.2%2C+2.3%5D%2C+%5B3%2C+1%2C+3.2%2C+2.6%5D&debug=0)**
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~9~~ ~~8~~ 7 bytes
Saved a byte as *Erik the Outgolfer* pointed out that a list of lists is valid input.
```
øεMsËi·
```
[Try it online!](https://tio.run/##MzBNTDJM/f//UcOswzvObfUtPtydeWj7///RusZ6RjoKUNJIz0RHwRzIMDTQM4zlijY0MIDJgaV04XIA "05AB1E – Try It Online")
**Explanation**
```
ø          # zip the lists
 ε         # apply to each pair
  M        # get max
   s       # swap the top 2 elements on the stack
    Ëi     # if all elements are equal
      ·    # double the max
```
[Answer]
# Mathematica, 31 bytes
```
MapThread[If[#==#2,2#,Max@##]&]
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~49~~ ~~46~~ 45 bytes
*3 bytes removed thanks to [@Mr.Xcoder](https://codegolf.stackexchange.com/users/59487/mr-xcoder) (splat instead of two arguments), and 1 byte thanks to [@ovs](https://codegolf.stackexchange.com/users/64121/ovs) (map instead of list comprehension)*
```
lambda*x:map(lambda a,b:a*(a>=b)+b*(b>=a),*x)
```
[Try it online!](https://tio.run/##Pcg9CoAwDEDhq3RMYhC04CDUi9QOCVIU/CnioKevBUF4y/fSc83HbnN0Y15l00no7jdJ8MEIay8EMjjFSgl0cIJMN@Z0LvsFniL4ho0t1S2btraBjS9s/tMFDJhf)
[Answer]
# J, 7 bytes
```
>.`+@.=
```
[Try it online!](https://tio.run/##y/r/P03BVk/BTi9B20HPlosrNTkjX0HDUMFYwVjPSMFIz1hTIU1Bw1jBEMo304QrMQIqMgFLmyqYKZgrWCCkwBAsBWP//w8A)
Takes one list as the left argument and the other as the right.
Luckily, equality is a rank zero operation.
# Explanation
```
>.`+@.=
      =  Compare equality pairwise
    @.   If equal
   +       Sum
>.       (Else) take greater value
```
`@.` isn't *really* an if statement, but in this case it functions as one (it indexes into the gerund `>.`+` based on the result of its right argument and applies that to the input).
[Answer]
# TI-Basic, ~~23~~ 21 bytes
```
Prompt A,B
(ʟA=ʟB)ʟA+max(ʟA,ʟB
```
Too bad lists take up two bytes each...
[Answer]
# [Uiua](https://uiua.org), 6 [bytes](https://www.uiua.org/pad?src=U0JDUyDihpAgK0BcMOKKlwpEZWNvZGUg4oaQIOKHjOKKjy0x4pa9wrEu4o2Y4ouv4oav4oqCwq8x4qe74ouv4qe7LOKHjOKItSjihpjCrzHii68rMjU2KSAtQFwwKzEKJnAg4oqCIjggYml0IGVuY29kaW5nOlx0IiBTQkNTICLih4ziio8tMeKWvcKxLuKNmOKLr-KGr-KKgsKvMeKnu-KLr-Knuyzih4ziiLUo4oaYwq8x4ouvKzI1NikiIOKKgitAXDDih6ExMjkiLiziiLY74oiYwqzCscKv4oy14oia4peL4oyK4oyI4oGFPeKJoDziiaQ-4omlKy3Dl8O34pe_4oG_4oKZ4oan4oal4oig4qe74paz4oeh4oqi4oeM4pmt4ouv4o2J4o2P4o2W4oqa4oqb4oqd4pah4oqU4omF4oqf4oqC4oqP4oqh4oav4oaZ4oaY4oa74per4pa94oyV4oiK4oqXL-KIp1xc4oi14omh4oi64oqe4oqg4o2l4oqV4oqc4oip4oqT4oqD4oqZ4ouF4o2Y4o2c4o2a4qyaJz_ijaPijaQh4o6L4oas4pqCzrfPgM-E4oiefl9bXXt9KCnCr0AkXCLihpB8IyIKJnAg4oqCImRlY29kZWQ6XHQiIERlY29kZSAiwqPCsS0xwrjChy7DjMKlwrPCsMKIMcKfwqXCnyzCo8K_KMK1wogxwqUrMjU2KSIg4oqCK0BcMOKHoTEyOSIuLOKItjviiJjCrMKxwq_ijLXiiJril4vijIrijIjigYU94omgPOKJpD7iiaUrLcOXw7fil7_igb_igpnihqfihqXiiKDip7vilrPih6HiiqLih4zima3ii6_ijYnijY_ijZbiipriipviip3ilqHiipTiiYXiip_iioLiio_iiqHihq_ihpnihpjihrvil6vilr3ijJXiiIriipcv4oinXFziiLXiiaHiiLriip7iiqDijaXiipXiipziiKniipPiioPiipnii4XijZjijZzijZrirJonP-KNo-KNpCHijovihqzimoLOt8-Az4TiiJ5-X1tde30oKcKvQCRcIuKGkHwjIg==)
```
×+1⊃=↥
```
[Try it!](https://uiua.org/pad?src=ZiDihpAgw5crMeKKgz3ihqUKCmYgW10gW10KZiBbMSAyIDNdIFsxIDMgMl0KZiBbMSAzIDMuMiAyLjNdIFszIDEgMy4yIDIuNl0=)
```
×+1⊃=↥
   ⊃=↥  # elementwise max and equality mask
 +1     # increment
×       # multiply
```
[Answer]
# Octave, 36 Byte
```
@(a,b)a.*(a>b)+b.*(b>a)+2.*a.*(a==b)
```
[Answer]
# Pyth, 7 bytes
```
ms.MZdC
```
[Try it here.](http://pyth.herokuapp.com/?code=ms.MZdC&input=%5B%5B1%2C+3%2C+3.2%2C+2.3%5D%2C+%5B3%2C+1%2C+3.2%2C+2.6%5D%5D&debug=0)
[Answer]
# Common Lisp, ~~60~~ 59 bytes
```
(mapcar(lambda(x y)(*(max x y)(if(= x y)2 1)))(read)(read))
```
[Try it online!](https://tio.run/##LYjBCoAgEAXvfcUe33YQdKFbH7NpgaAh1sG@3iK8DDPjU7xKR6nxvKkja/FakTRvQdHoYczfbPRrPLD@5sgyM@quYZA7d1gSEuPIGeEJQnbUwi8)
*-1 byte thanks to @Zacharý!*
[Answer]
# Python with numpy, 28 bytes
```
lambda a,b:a*(a>=b)+b*(b>=a)
```
Assumes input is given as two numpy arrays.
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), using Linq 47+18=65 bytes
```
x=>y=>x.Zip(y,(a,b)=>a>b?a:b>a?b:b+a).ToArray()
```
[Try it online!](https://tio.run/##fY5BS8MwFMfP9lM8iocEY2AbeFhthggeRE8TBEsPL1k2AjWZSaorpZ@9RqFOhgjv8H68H@//V@FSOa/HNhi7g3UXon4tst/EH4x9KzLVYAiw77MQMRoFd61VcL1xrWx0VbMvPNK0CLEtx0MpulIc@IvZk44RZJKWAoVc4VIKXMmlvEDKn9yN99gROhZTxLszG3hEY0mIPhWqakC/C7TPzm6dDa7R/NmbqFNBTdbfCr93Sc9ZzrbE6g@YikAPMwaLNHzOYM4XMNBTIV1nP8JVEigt/ko6z6v@/7T@5HliOtR5ejcM4yc "C# (.NET Core) – Try It Online")
# C# (.NET Core), 82 bytes
```
x=>y=>l=>{for(int i=0;i<l;i++)x[i]=x[i]>y[i]?x[i]:y[i]>x[i]?y[i]:y[i]*2;return x;}
```
[Try it online!](https://tio.run/##fY9NS8QwEIbP9lcMxUPjxrLbFQ9mkz0IHkRPe/BQeqjddAl0kzVJtSXkt9dEqIciwjC878zDfDTmtlGaT7I@c3OpGw6H0Vh@zl@E/HBJ09XGwMUlxtZWNPDUywZ2R9W/d7yscLQLJ6TFc4Ux1tJpoGykrKPMtUpnoQ@CronYdUSsVmgoRUVjYmNI@6geomJR7cfZ3hREc9trCQPxE5nv@VTiCK@1kJmxWshTWUGtTwa55OpRSaM6nr9pYXn4hmeHHyR/VgFPcYrbTPIvmI8FBxsM2xB5gaHIt@DREgjdzS9wH4E7hBD5a9l1Wrr/F7rF/OjXCPkqDRO999M3 "C# (.NET Core) – Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~34~~ 28 bytes
```
{map {.max*2/set $_},[Z] $_}
```
[Try it online!](https://tio.run/##XYzBDsIgEETvfsUeelCzRRaQ1hh/REIMh3qSpGk9aBq/HRfURg3JMjvzdvpuuNgU71Cd4ZCmGHqYRAy3tdqM3RWq0wPd0ec/jSFTS@cIQSFoj5Cl5s371X7xnbOpBUNKFIxXmh37TyvUaHDLr8EWd0iyVEuWLVuWA8OIQvq9rEvheyphEBoWJAW97uUnLFk9h1ySng "Perl 6 – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~8~~ 7 bytes
```
Zƛ≈[∑|G
```
*-1 byte thanks to [@emanresu A](https://codegolf.stackexchange.com/users/100664/emanresu-a)*
Add the `ḋ` flag if you want to see the numbers in decimal format.
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCJaxpviiYhb4oiRfEciLCIiLCJbLTMuMiwgLTMuMiwgLTIuNCwgNywgLTEwLjFdXG5bMTAwLCAtMy4yLCAyLjQsIC03LCAtMTAuMV0iXQ==)
Explanation:
```
Z        # Zip
 ƛ       # On each pair
   [     # If
  ≈      # All are equal
    ∑    # Sum
     |   # Otherwise
      G  # Get the greatest value
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 6 bytes
```
₌Þ∴=›*
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLigozDnuKItD3igLoqIiwiIiwiWzEsIDIsIDNdXG5bMSwgMywgMl0iXQ==)
```
₌      # Do both of these...
 Þ∴    # Elementwise maximum
   =›  # Equality, incremented -> list of 1s where unequal, 2s where equal
     * # Multiply by that.
```
[Answer]
# Swift 3, ~~81~~ 79 Bytes
```
func n(a:[Double],b:[Double]){for(x,y)in zip(a,b){print((x==y) ?x+y:max(x,y))}}
```
Swift has an interesting property in that an Int isn't directly castable to a `Double`, so you have to specify any arrays as being arrays of `Double`s before passing them to the function.
(e.g.) `var k:[Double] = [1,2,3,4,5,5,7,8,9,10]`
Edit: -2 bytes thanks to @EriktheOutgolfer
[Answer]
# C, ~~76~~ 75 bytes
*Thanks to @Kevin Cruijssen for saving a byte!*
```
f(a,b,n)float*a,*b;{for(;n--;++a,++b)printf("%f ",*a>*b?*a:*b>*a?*b:*a*2);}
```
[Try it online!](https://tio.run/##dZDdaoNAEEbvfYpFKOyuo7irJmmWJg9SejEbMARaE1J7JT67/Wpi/QFdRmTmzHcWT/H5dOq6UjJ5qlT5eeVaM2nvmvJ6l66KYxdFTFHk1e1@qepShi@lCEnzQfuj5r32B81H7featVWu7QCJL75UUgVNIPD0oYLN@4d4E03rJk2/aEo2hCaJVLnbT/0tw1C5YJpiHwtALIlsHjbOMozHTJD@j17LzKZ7WQLUJovoJ4K5@Uc2owF9j8rXDPlgsJRRTgXOlnb0SiadewYwxWwHZgMyx44lM9py2FBm9ScVj5S4v@jzbROsbPFh0sTMpcUgTQe6h@MlLbmAGVXA13a/)
]