Average Error: 10.8 → 1.3
Time: 6.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 r745294 = x;
        double r745295 = y;
        double r745296 = z;
        double r745297 = t;
        double r745298 = r745296 - r745297;
        double r745299 = r745295 * r745298;
        double r745300 = a;
        double r745301 = r745300 - r745297;
        double r745302 = r745299 / r745301;
        double r745303 = r745294 + r745302;
        return r745303;
}

double f(double x, double y, double z, double t, double a) {
        double r745304 = x;
        double r745305 = y;
        double r745306 = z;
        double r745307 = t;
        double r745308 = r745306 - r745307;
        double r745309 = a;
        double r745310 = r745309 - r745307;
        double r745311 = r745308 / r745310;
        double r745312 = r745305 * r745311;
        double r745313 = r745304 + r745312;
        return r745313;
}

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

Original10.8
Target1.2
Herbie1.3
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 10.8

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

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

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

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

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

Reproduce

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