Average Error: 28.6 → 0.2
Time: 10.6s
Precision: 64
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
\[0.5 \cdot \left(\left(y + \frac{{1}^{1}}{\frac{\frac{y}{x}}{x}}\right) - z \cdot \frac{z}{y}\right)\]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
0.5 \cdot \left(\left(y + \frac{{1}^{1}}{\frac{\frac{y}{x}}{x}}\right) - z \cdot \frac{z}{y}\right)
double f(double x, double y, double z) {
        double r551359 = x;
        double r551360 = r551359 * r551359;
        double r551361 = y;
        double r551362 = r551361 * r551361;
        double r551363 = r551360 + r551362;
        double r551364 = z;
        double r551365 = r551364 * r551364;
        double r551366 = r551363 - r551365;
        double r551367 = 2.0;
        double r551368 = r551361 * r551367;
        double r551369 = r551366 / r551368;
        return r551369;
}

double f(double x, double y, double z) {
        double r551370 = 0.5;
        double r551371 = y;
        double r551372 = 1.0;
        double r551373 = pow(r551372, r551372);
        double r551374 = x;
        double r551375 = r551371 / r551374;
        double r551376 = r551375 / r551374;
        double r551377 = r551373 / r551376;
        double r551378 = r551371 + r551377;
        double r551379 = z;
        double r551380 = r551379 / r551371;
        double r551381 = r551379 * r551380;
        double r551382 = r551378 - r551381;
        double r551383 = r551370 * r551382;
        return r551383;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original28.6
Target0.2
Herbie0.2
\[y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right)\]

Derivation

  1. Initial program 28.6

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
  2. Taylor expanded around 0 12.7

    \[\leadsto \color{blue}{\left(0.5 \cdot y + 0.5 \cdot \frac{{x}^{2}}{y}\right) - 0.5 \cdot \frac{{z}^{2}}{y}}\]
  3. Simplified12.7

    \[\leadsto \color{blue}{0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \frac{{z}^{2}}{y}\right)}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity12.7

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \frac{{z}^{2}}{\color{blue}{1 \cdot y}}\right)\]
  6. Applied add-sqr-sqrt38.3

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \frac{{\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)}}^{2}}{1 \cdot y}\right)\]
  7. Applied unpow-prod-down38.3

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \frac{\color{blue}{{\left(\sqrt{z}\right)}^{2} \cdot {\left(\sqrt{z}\right)}^{2}}}{1 \cdot y}\right)\]
  8. Applied times-frac35.6

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \color{blue}{\frac{{\left(\sqrt{z}\right)}^{2}}{1} \cdot \frac{{\left(\sqrt{z}\right)}^{2}}{y}}\right)\]
  9. Simplified35.6

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \color{blue}{z} \cdot \frac{{\left(\sqrt{z}\right)}^{2}}{y}\right)\]
  10. Simplified6.9

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - z \cdot \color{blue}{\frac{z}{y}}\right)\]
  11. Using strategy rm
  12. Applied sqr-pow6.9

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{\color{blue}{{x}^{\left(\frac{2}{2}\right)} \cdot {x}^{\left(\frac{2}{2}\right)}}}{y}\right) - z \cdot \frac{z}{y}\right)\]
  13. Applied associate-/l*0.1

    \[\leadsto 0.5 \cdot \left(\left(y + \color{blue}{\frac{{x}^{\left(\frac{2}{2}\right)}}{\frac{y}{{x}^{\left(\frac{2}{2}\right)}}}}\right) - z \cdot \frac{z}{y}\right)\]
  14. Simplified0.1

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{\left(\frac{2}{2}\right)}}{\color{blue}{\frac{y}{x}}}\right) - z \cdot \frac{z}{y}\right)\]
  15. Using strategy rm
  16. Applied *-un-lft-identity0.1

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{\color{blue}{\left(1 \cdot x\right)}}^{\left(\frac{2}{2}\right)}}{\frac{y}{x}}\right) - z \cdot \frac{z}{y}\right)\]
  17. Applied unpow-prod-down0.1

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{\color{blue}{{1}^{\left(\frac{2}{2}\right)} \cdot {x}^{\left(\frac{2}{2}\right)}}}{\frac{y}{x}}\right) - z \cdot \frac{z}{y}\right)\]
  18. Applied associate-/l*0.2

    \[\leadsto 0.5 \cdot \left(\left(y + \color{blue}{\frac{{1}^{\left(\frac{2}{2}\right)}}{\frac{\frac{y}{x}}{{x}^{\left(\frac{2}{2}\right)}}}}\right) - z \cdot \frac{z}{y}\right)\]
  19. Simplified0.2

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{1}^{\left(\frac{2}{2}\right)}}{\color{blue}{\frac{\frac{y}{x}}{x}}}\right) - z \cdot \frac{z}{y}\right)\]
  20. Final simplification0.2

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{1}^{1}}{\frac{\frac{y}{x}}{x}}\right) - z \cdot \frac{z}{y}\right)\]

Reproduce

herbie shell --seed 2019294 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
  :precision binary64

  :herbie-target
  (- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))

  (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2)))