Average Error: 28.5 → 0.2
Time: 2.9s
Precision: 64
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}\]
\[0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \frac{z}{y} \cdot z\right)\]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
0.5 \cdot \left(\left(y + \left|x\right| \cdot \frac{\left|x\right|}{y}\right) - \frac{z}{y} \cdot z\right)
double f(double x, double y, double z) {
        double r756411 = x;
        double r756412 = r756411 * r756411;
        double r756413 = y;
        double r756414 = r756413 * r756413;
        double r756415 = r756412 + r756414;
        double r756416 = z;
        double r756417 = r756416 * r756416;
        double r756418 = r756415 - r756417;
        double r756419 = 2.0;
        double r756420 = r756413 * r756419;
        double r756421 = r756418 / r756420;
        return r756421;
}

double f(double x, double y, double z) {
        double r756422 = 0.5;
        double r756423 = y;
        double r756424 = x;
        double r756425 = fabs(r756424);
        double r756426 = r756425 / r756423;
        double r756427 = r756425 * r756426;
        double r756428 = r756423 + r756427;
        double r756429 = z;
        double r756430 = r756429 / r756423;
        double r756431 = r756430 * r756429;
        double r756432 = r756428 - r756431;
        double r756433 = r756422 * r756432;
        return r756433;
}

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

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

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

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

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

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

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

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

    \[\leadsto 0.5 \cdot \left(\left(y + \left|x\right| \cdot \color{blue}{\frac{\left|x\right|}{y}}\right) - \frac{z}{\frac{y}{z}}\right)\]
  13. Using strategy rm
  14. Applied associate-/r/0.2

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

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

Reproduce

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