Average Error: 0.0 → 0.0
Time: 2.2min
Precision: binary64
Cost: 1088
\[\left(x + 1\right) \cdot y - x\]
\[\left(\left(y \cdot \left(1 + x\right)\right) \cdot 0.5 + 0.5 \cdot \left(y + y \cdot x\right)\right) - x\]
\left(x + 1\right) \cdot y - x
\left(\left(y \cdot \left(1 + x\right)\right) \cdot 0.5 + 0.5 \cdot \left(y + y \cdot x\right)\right) - x
(FPCore (x y) :precision binary64 (- (* (+ x 1.0) y) x))
(FPCore (x y)
 :precision binary64
 (- (+ (* (* y (+ 1.0 x)) 0.5) (* 0.5 (+ y (* y x)))) x))
double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
double code(double x, double y) {
	return (((y * (1.0 + x)) * 0.5) + (0.5 * (y + (y * x)))) - x;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.0
Cost448
\[y \cdot \left(1 + x\right) - x\]
Alternative 2
Error0.8
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -1.0166592441616427 \lor \neg \left(x \leq 1.9523213706475706 \cdot 10^{-05}\right):\\ \;\;\;\;y \cdot x - x\\ \mathbf{else}:\\ \;\;\;\;y - x\\ \end{array}\]
Alternative 3
Error9.3
Cost192
\[y - x\]
Alternative 4
Error17.9
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -3.3833836173781544 \cdot 10^{-30} \lor \neg \left(x \leq 5.7719032351248107 \cdot 10^{-11}\right):\\ \;\;\;\;-x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array}\]
Alternative 5
Error36.0
Cost64
\[y\]

Error

Time

Derivation

  1. Initial program 0.0

    \[\left(x + 1\right) \cdot y - x\]
  2. Using strategy rm
  3. Applied add-log-exp_binary64_966544.8

    \[\leadsto \color{blue}{\log \left(e^{\left(x + 1\right) \cdot y}\right)} - x\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt_binary64_964844.8

    \[\leadsto \log \color{blue}{\left(\sqrt{e^{\left(x + 1\right) \cdot y}} \cdot \sqrt{e^{\left(x + 1\right) \cdot y}}\right)} - x\]
  6. Applied log-prod_binary64_971244.8

    \[\leadsto \color{blue}{\left(\log \left(\sqrt{e^{\left(x + 1\right) \cdot y}}\right) + \log \left(\sqrt{e^{\left(x + 1\right) \cdot y}}\right)\right)} - x\]
  7. Simplified43.6

    \[\leadsto \left(\color{blue}{0.5 \cdot \left(\left(x + 1\right) \cdot y\right)} + \log \left(\sqrt{e^{\left(x + 1\right) \cdot y}}\right)\right) - x\]
  8. Simplified0.0

    \[\leadsto \left(0.5 \cdot \left(\left(x + 1\right) \cdot y\right) + \color{blue}{0.5 \cdot \left(\left(x + 1\right) \cdot y\right)}\right) - x\]
  9. Using strategy rm
  10. Applied add-exp-log_binary64_966433.5

    \[\leadsto \left(0.5 \cdot \left(\left(x + 1\right) \cdot \color{blue}{e^{\log y}}\right) + 0.5 \cdot \left(\left(x + 1\right) \cdot y\right)\right) - x\]
  11. Applied add-exp-log_binary64_966439.9

    \[\leadsto \left(0.5 \cdot \left(\color{blue}{e^{\log \left(x + 1\right)}} \cdot e^{\log y}\right) + 0.5 \cdot \left(\left(x + 1\right) \cdot y\right)\right) - x\]
  12. Applied prod-exp_binary64_967539.9

    \[\leadsto \left(0.5 \cdot \color{blue}{e^{\log \left(x + 1\right) + \log y}} + 0.5 \cdot \left(\left(x + 1\right) \cdot y\right)\right) - x\]
  13. Simplified33.0

    \[\leadsto \left(0.5 \cdot e^{\color{blue}{\log \left(\left(x + 1\right) \cdot y\right)}} + 0.5 \cdot \left(\left(x + 1\right) \cdot y\right)\right) - x\]
  14. Taylor expanded around inf 49.5

    \[\leadsto \left(0.5 \cdot \color{blue}{\left(e^{\log y - \log \left(\frac{1}{x}\right)} + \frac{e^{\log y - \log \left(\frac{1}{x}\right)}}{x}\right)} + 0.5 \cdot \left(\left(x + 1\right) \cdot y\right)\right) - x\]
  15. Simplified0.0

    \[\leadsto \left(0.5 \cdot \color{blue}{\left(x \cdot y + \frac{y}{1}\right)} + 0.5 \cdot \left(\left(x + 1\right) \cdot y\right)\right) - x\]
  16. Simplified0.0

    \[\leadsto \color{blue}{\left(\left(y \cdot \left(1 + x\right)\right) \cdot 0.5 + 0.5 \cdot \left(y + y \cdot x\right)\right) - x}\]
  17. Final simplification0.0

    \[\leadsto \left(\left(y \cdot \left(1 + x\right)\right) \cdot 0.5 + 0.5 \cdot \left(y + y \cdot x\right)\right) - x\]

Reproduce

herbie shell --seed 2021040 
(FPCore (x y)
  :name "Data.Colour.SRGB:transferFunction from colour-2.3.3"
  :precision binary64
  (- (* (+ x 1.0) y) x))