Average Error: 13.4 → 2.4
Time: 31.5s
Precision: 64
Internal Precision: 1088
$\left(l_M + r_M\right) + \frac{\left(\left(d \cdot d\right) \cdot l_c\right) \cdot r_c}{l_c + r_c}$
$\begin{array}{l} \mathbf{if}\;\left(l_M + r_M\right) + d \cdot \left(\left(d \cdot l_c\right) \cdot \frac{r_c}{l_c + r_c}\right) \le 2.294918378299745 \cdot 10^{+303}:\\ \;\;\;\;\left(l_M + r_M\right) + d \cdot \left(\left(d \cdot l_c\right) \cdot \frac{r_c}{l_c + r_c}\right)\\ \mathbf{else}:\\ \;\;\;\;r_M + l_M\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if (+ (+ l_M r_M) (* d (* (* d l_c) (/ r_c (+ l_c r_c))))) < 2.294918378299745e+303

1. Initial program 11.3

$\left(l_M + r_M\right) + \frac{\left(\left(d \cdot d\right) \cdot l_c\right) \cdot r_c}{l_c + r_c}$
2. Using strategy rm
3. Applied *-un-lft-identity11.3

$\leadsto \left(l_M + r_M\right) + \frac{\left(\left(d \cdot d\right) \cdot l_c\right) \cdot r_c}{\color{blue}{1 \cdot \left(l_c + r_c\right)}}$
4. Applied times-frac8.2

$\leadsto \left(l_M + r_M\right) + \color{blue}{\frac{\left(d \cdot d\right) \cdot l_c}{1} \cdot \frac{r_c}{l_c + r_c}}$
5. Applied simplify3.6

$\leadsto \left(l_M + r_M\right) + \color{blue}{\left(d \cdot \left(d \cdot l_c\right)\right)} \cdot \frac{r_c}{l_c + r_c}$
6. Using strategy rm
7. Applied associate-*l*0.8

$\leadsto \left(l_M + r_M\right) + \color{blue}{d \cdot \left(\left(d \cdot l_c\right) \cdot \frac{r_c}{l_c + r_c}\right)}$

## if 2.294918378299745e+303 < (+ (+ l_M r_M) (* d (* (* d l_c) (/ r_c (+ l_c r_c)))))

1. Initial program 52.2

$\left(l_M + r_M\right) + \frac{\left(\left(d \cdot d\right) \cdot l_c\right) \cdot r_c}{l_c + r_c}$
2. Taylor expanded around 0 30.2

$\leadsto \left(l_M + r_M\right) + \frac{\color{blue}{0} \cdot r_c}{l_c + r_c}$
3. Applied simplify30.2

$\leadsto \color{blue}{r_M + l_M}$
3. Recombined 2 regimes into one program.

# Runtime

Time bar (total: 31.5s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (l_M r_M d l_c r_c)
:name "l_M + r_M + d * d * l_c * r_c / (l_c + r_c)"
(+ (+ l_M r_M) (/ (* (* (* d d) l_c) r_c) (+ l_c r_c))))