Average Error: 10.5 → 1.1
Time: 12.5s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[x + t \cdot \frac{y - z}{a - z}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
x + t \cdot \frac{y - z}{a - z}
double f(double x, double y, double z, double t, double a) {
        double r23907138 = x;
        double r23907139 = y;
        double r23907140 = z;
        double r23907141 = r23907139 - r23907140;
        double r23907142 = t;
        double r23907143 = r23907141 * r23907142;
        double r23907144 = a;
        double r23907145 = r23907144 - r23907140;
        double r23907146 = r23907143 / r23907145;
        double r23907147 = r23907138 + r23907146;
        return r23907147;
}

double f(double x, double y, double z, double t, double a) {
        double r23907148 = x;
        double r23907149 = t;
        double r23907150 = y;
        double r23907151 = z;
        double r23907152 = r23907150 - r23907151;
        double r23907153 = a;
        double r23907154 = r23907153 - r23907151;
        double r23907155 = r23907152 / r23907154;
        double r23907156 = r23907149 * r23907155;
        double r23907157 = r23907148 + r23907156;
        return r23907157;
}

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.5
Target0.5
Herbie1.1
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Initial program 10.5

    \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
  2. Using strategy rm
  3. Applied associate-/l*2.9

    \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
  4. Using strategy rm
  5. Applied associate-/r/1.1

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

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

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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