Average Error: 11.7 → 1.2
Time: 3.3s
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}{2 \cdot z - \frac{t}{z} \cdot 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}{2 \cdot z - \frac{t}{z} \cdot y}
double f(double x, double y, double z, double t) {
        double r426738 = x;
        double r426739 = y;
        double r426740 = 2.0;
        double r426741 = r426739 * r426740;
        double r426742 = z;
        double r426743 = r426741 * r426742;
        double r426744 = r426742 * r426740;
        double r426745 = r426744 * r426742;
        double r426746 = t;
        double r426747 = r426739 * r426746;
        double r426748 = r426745 - r426747;
        double r426749 = r426743 / r426748;
        double r426750 = r426738 - r426749;
        return r426750;
}

double f(double x, double y, double z, double t) {
        double r426751 = x;
        double r426752 = y;
        double r426753 = 2.0;
        double r426754 = r426752 * r426753;
        double r426755 = z;
        double r426756 = r426753 * r426755;
        double r426757 = t;
        double r426758 = r426757 / r426755;
        double r426759 = r426758 * r426752;
        double r426760 = r426756 - r426759;
        double r426761 = r426754 / r426760;
        double r426762 = r426751 - r426761;
        return r426762;
}

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

Derivation

  1. Initial program 11.7

    \[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*6.9

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

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

    \[\leadsto x - \frac{y \cdot 2}{2 \cdot z - \color{blue}{\frac{t}{\frac{z}{y}}}}\]
  7. Using strategy rm
  8. Applied associate-/r/1.2

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

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

Reproduce

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