Average Error: 11.0 → 1.4
Time: 9.6s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r610044 = x;
        double r610045 = y;
        double r610046 = z;
        double r610047 = t;
        double r610048 = r610046 - r610047;
        double r610049 = r610045 * r610048;
        double r610050 = a;
        double r610051 = r610050 - r610047;
        double r610052 = r610049 / r610051;
        double r610053 = r610044 + r610052;
        return r610053;
}

double f(double x, double y, double z, double t, double a) {
        double r610054 = x;
        double r610055 = y;
        double r610056 = z;
        double r610057 = t;
        double r610058 = r610056 - r610057;
        double r610059 = a;
        double r610060 = r610059 - r610057;
        double r610061 = r610058 / r610060;
        double r610062 = r610055 * r610061;
        double r610063 = r610054 + r610062;
        return r610063;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.0
Target1.3
Herbie1.4
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 11.0

    \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity11.0

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

    \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
  5. Simplified1.4

    \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a - t}\]
  6. Final simplification1.4

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

Reproduce

herbie shell --seed 2019350 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

  (+ x (/ (* y (- z t)) (- a t))))