Average Error: 29.0 → 0.2
Time: 5.7s
Precision: 64
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
\[0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - z \cdot \frac{{z}^{1}}{y}\right)\]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
0.5 \cdot \left(\left(y + \frac{{x}^{1}}{\frac{y}{x}}\right) - z \cdot \frac{{z}^{1}}{y}\right)
double f(double x, double y, double z) {
        double r589834 = x;
        double r589835 = r589834 * r589834;
        double r589836 = y;
        double r589837 = r589836 * r589836;
        double r589838 = r589835 + r589837;
        double r589839 = z;
        double r589840 = r589839 * r589839;
        double r589841 = r589838 - r589840;
        double r589842 = 2.0;
        double r589843 = r589836 * r589842;
        double r589844 = r589841 / r589843;
        return r589844;
}

double f(double x, double y, double z) {
        double r589845 = 0.5;
        double r589846 = y;
        double r589847 = x;
        double r589848 = 1.0;
        double r589849 = pow(r589847, r589848);
        double r589850 = r589846 / r589847;
        double r589851 = r589849 / r589850;
        double r589852 = r589846 + r589851;
        double r589853 = z;
        double r589854 = pow(r589853, r589848);
        double r589855 = r589854 / r589846;
        double r589856 = r589853 * r589855;
        double r589857 = r589852 - r589856;
        double r589858 = r589845 * r589857;
        return r589858;
}

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

Original29.0
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 29.0

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

    \[\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.8

    \[\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 sqr-pow12.8

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

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

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

    \[\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) - \frac{{z}^{\left(\frac{2}{2}\right)}}{\frac{y}{z}}\right)\]
  10. Applied associate-/l*0.2

    \[\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) - \frac{{z}^{\left(\frac{2}{2}\right)}}{\frac{y}{z}}\right)\]
  11. Simplified0.2

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

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{\left(\frac{2}{2}\right)}}{\frac{y}{x}}\right) - \frac{{z}^{\left(\frac{2}{2}\right)}}{\frac{y}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}\right)\]
  14. Applied *-un-lft-identity32.3

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020002 
(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)))