Average Error: 11.6 → 0.9
Time: 14.5s
Precision: 64
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - \frac{y}{1 \cdot z - 0.5 \cdot \left(\frac{t}{z} \cdot y\right)}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y}{1 \cdot z - 0.5 \cdot \left(\frac{t}{z} \cdot y\right)}
double f(double x, double y, double z, double t) {
        double r33264076 = x;
        double r33264077 = y;
        double r33264078 = 2.0;
        double r33264079 = r33264077 * r33264078;
        double r33264080 = z;
        double r33264081 = r33264079 * r33264080;
        double r33264082 = r33264080 * r33264078;
        double r33264083 = r33264082 * r33264080;
        double r33264084 = t;
        double r33264085 = r33264077 * r33264084;
        double r33264086 = r33264083 - r33264085;
        double r33264087 = r33264081 / r33264086;
        double r33264088 = r33264076 - r33264087;
        return r33264088;
}

double f(double x, double y, double z, double t) {
        double r33264089 = x;
        double r33264090 = y;
        double r33264091 = 1.0;
        double r33264092 = z;
        double r33264093 = r33264091 * r33264092;
        double r33264094 = 0.5;
        double r33264095 = t;
        double r33264096 = r33264095 / r33264092;
        double r33264097 = r33264096 * r33264090;
        double r33264098 = r33264094 * r33264097;
        double r33264099 = r33264093 - r33264098;
        double r33264100 = r33264090 / r33264099;
        double r33264101 = r33264089 - r33264100;
        return r33264101;
}

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

Derivation

  1. Initial program 11.6

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

    \[\leadsto \color{blue}{x - \frac{y}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z \cdot 2}}}\]
  3. Taylor expanded around 0 2.8

    \[\leadsto x - \frac{y}{\color{blue}{1 \cdot z - 0.5 \cdot \frac{t \cdot y}{z}}}\]
  4. Using strategy rm
  5. Applied associate-/l*2.1

    \[\leadsto x - \frac{y}{1 \cdot z - 0.5 \cdot \color{blue}{\frac{t}{\frac{z}{y}}}}\]
  6. Using strategy rm
  7. Applied associate-/r/0.9

    \[\leadsto x - \frac{y}{1 \cdot z - 0.5 \cdot \color{blue}{\left(\frac{t}{z} \cdot y\right)}}\]
  8. Final simplification0.9

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x y z t)
  :name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"

  :herbie-target
  (- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z))))

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