Average Error: 11.2 → 1.0
Time: 3.8s
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}{1 \cdot \left(2 \cdot z - \frac{\frac{t}{z}}{\frac{1}{y}}\right)}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \frac{\frac{t}{z}}{\frac{1}{y}}\right)}
double f(double x, double y, double z, double t) {
        double r731217 = x;
        double r731218 = y;
        double r731219 = 2.0;
        double r731220 = r731218 * r731219;
        double r731221 = z;
        double r731222 = r731220 * r731221;
        double r731223 = r731221 * r731219;
        double r731224 = r731223 * r731221;
        double r731225 = t;
        double r731226 = r731218 * r731225;
        double r731227 = r731224 - r731226;
        double r731228 = r731222 / r731227;
        double r731229 = r731217 - r731228;
        return r731229;
}

double f(double x, double y, double z, double t) {
        double r731230 = x;
        double r731231 = y;
        double r731232 = 2.0;
        double r731233 = r731231 * r731232;
        double r731234 = 1.0;
        double r731235 = z;
        double r731236 = r731232 * r731235;
        double r731237 = t;
        double r731238 = r731237 / r731235;
        double r731239 = r731234 / r731231;
        double r731240 = r731238 / r731239;
        double r731241 = r731236 - r731240;
        double r731242 = r731234 * r731241;
        double r731243 = r731233 / r731242;
        double r731244 = r731230 - r731243;
        return r731244;
}

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

Derivation

  1. Initial program 11.2

    \[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.3

    \[\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 *-un-lft-identity6.3

    \[\leadsto x - \frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{\color{blue}{1 \cdot z}}}\]
  6. Applied *-un-lft-identity6.3

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

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

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

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \color{blue}{\left(2 \cdot z - \frac{t \cdot y}{z}\right)}}\]
  10. Using strategy rm
  11. Applied associate-/l*2.2

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \color{blue}{\frac{t}{\frac{z}{y}}}\right)}\]
  12. Using strategy rm
  13. Applied div-inv2.3

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

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \color{blue}{\frac{\frac{t}{z}}{\frac{1}{y}}}\right)}\]
  15. Final simplification1.0

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

Reproduce

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