Average Error: 11.9 → 6.8
Time: 5.3s
Precision: 64
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - \left(y \cdot 2\right) \cdot \frac{z}{2 \cdot {z}^{2} - t \cdot y}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \left(y \cdot 2\right) \cdot \frac{z}{2 \cdot {z}^{2} - t \cdot y}
double f(double x, double y, double z, double t) {
        double r632820 = x;
        double r632821 = y;
        double r632822 = 2.0;
        double r632823 = r632821 * r632822;
        double r632824 = z;
        double r632825 = r632823 * r632824;
        double r632826 = r632824 * r632822;
        double r632827 = r632826 * r632824;
        double r632828 = t;
        double r632829 = r632821 * r632828;
        double r632830 = r632827 - r632829;
        double r632831 = r632825 / r632830;
        double r632832 = r632820 - r632831;
        return r632832;
}

double f(double x, double y, double z, double t) {
        double r632833 = x;
        double r632834 = y;
        double r632835 = 2.0;
        double r632836 = r632834 * r632835;
        double r632837 = z;
        double r632838 = 2.0;
        double r632839 = pow(r632837, r632838);
        double r632840 = r632835 * r632839;
        double r632841 = t;
        double r632842 = r632841 * r632834;
        double r632843 = r632840 - r632842;
        double r632844 = r632837 / r632843;
        double r632845 = r632836 * r632844;
        double r632846 = r632833 - r632845;
        return r632846;
}

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.9
Target0.1
Herbie6.8
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Derivation

  1. Initial program 11.9

    \[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 *-un-lft-identity11.9

    \[\leadsto x - \frac{\left(y \cdot 2\right) \cdot z}{\color{blue}{1 \cdot \left(\left(z \cdot 2\right) \cdot z - y \cdot t\right)}}\]
  4. Applied times-frac6.8

    \[\leadsto x - \color{blue}{\frac{y \cdot 2}{1} \cdot \frac{z}{\left(z \cdot 2\right) \cdot z - y \cdot t}}\]
  5. Simplified6.8

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

    \[\leadsto x - \left(y \cdot 2\right) \cdot \color{blue}{\frac{z}{2 \cdot {z}^{2} - t \cdot y}}\]
  7. Final simplification6.8

    \[\leadsto x - \left(y \cdot 2\right) \cdot \frac{z}{2 \cdot {z}^{2} - t \cdot y}\]

Reproduce

herbie shell --seed 2020034 +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)))))