Average Error: 28.6 → 0.2
Time: 3.3s
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}{\frac{y}{x}}\right) - \left|z\right| \cdot \frac{\left|z\right|}{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}{\frac{y}{x}}\right) - \left|z\right| \cdot \frac{\left|z\right|}{y}\right)
double f(double x, double y, double z) {
        double r716627 = x;
        double r716628 = r716627 * r716627;
        double r716629 = y;
        double r716630 = r716629 * r716629;
        double r716631 = r716628 + r716630;
        double r716632 = z;
        double r716633 = r716632 * r716632;
        double r716634 = r716631 - r716633;
        double r716635 = 2.0;
        double r716636 = r716629 * r716635;
        double r716637 = r716634 / r716636;
        return r716637;
}

double f(double x, double y, double z) {
        double r716638 = 0.5;
        double r716639 = y;
        double r716640 = x;
        double r716641 = r716639 / r716640;
        double r716642 = r716640 / r716641;
        double r716643 = r716639 + r716642;
        double r716644 = z;
        double r716645 = fabs(r716644);
        double r716646 = r716645 / r716639;
        double r716647 = r716645 * r716646;
        double r716648 = r716643 - r716647;
        double r716649 = r716638 * r716648;
        return r716649;
}

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.5

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

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

    \[\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-sqrt12.5

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

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

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

    \[\leadsto 0.5 \cdot \left(\left(y + \frac{{x}^{2}}{y}\right) - \left|z\right| \cdot \color{blue}{\frac{\left|z\right|}{y}}\right)\]
  10. Using strategy rm
  11. Applied unpow26.7

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

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

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

Reproduce

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