Average Error: 11.8 → 1.0
Time: 3.9s
Precision: 64
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - \frac{y \cdot 2}{z \cdot 2 - \frac{\frac{t}{z}}{\frac{1}{y}}}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y \cdot 2}{z \cdot 2 - \frac{\frac{t}{z}}{\frac{1}{y}}}
double f(double x, double y, double z, double t) {
        double r418811 = x;
        double r418812 = y;
        double r418813 = 2.0;
        double r418814 = r418812 * r418813;
        double r418815 = z;
        double r418816 = r418814 * r418815;
        double r418817 = r418815 * r418813;
        double r418818 = r418817 * r418815;
        double r418819 = t;
        double r418820 = r418812 * r418819;
        double r418821 = r418818 - r418820;
        double r418822 = r418816 / r418821;
        double r418823 = r418811 - r418822;
        return r418823;
}

double f(double x, double y, double z, double t) {
        double r418824 = x;
        double r418825 = y;
        double r418826 = 2.0;
        double r418827 = r418825 * r418826;
        double r418828 = z;
        double r418829 = r418828 * r418826;
        double r418830 = t;
        double r418831 = r418830 / r418828;
        double r418832 = 1.0;
        double r418833 = r418832 / r418825;
        double r418834 = r418831 / r418833;
        double r418835 = r418829 - r418834;
        double r418836 = r418827 / r418835;
        double r418837 = r418824 - r418836;
        return r418837;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.8
Target0.1
Herbie1.0
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Derivation

  1. Initial program 11.8

    \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
  2. Using strategy rm
  3. Applied associate-/l*7.0

    \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}}\]
  4. Using strategy rm
  5. Applied div-sub7.0

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{\frac{\left(z \cdot 2\right) \cdot z}{z} - \frac{y \cdot t}{z}}}\]
  6. Simplified2.9

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{z \cdot 2} - \frac{y \cdot t}{z}}\]
  7. Simplified2.9

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \color{blue}{\frac{t \cdot y}{z}}}\]
  8. Using strategy rm
  9. Applied associate-/l*2.1

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \color{blue}{\frac{t}{\frac{z}{y}}}}\]
  10. Using strategy rm
  11. Applied div-inv2.1

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \frac{t}{\color{blue}{z \cdot \frac{1}{y}}}}\]
  12. Applied associate-/r*1.0

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \color{blue}{\frac{\frac{t}{z}}{\frac{1}{y}}}}\]
  13. Final simplification1.0

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \frac{\frac{t}{z}}{\frac{1}{y}}}\]

Reproduce

herbie shell --seed 2020039 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
  :precision binary64

  :herbie-target
  (- x (/ 1 (- (/ z y) (/ (/ t 2) z))))

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