Average Error: 1.3 → 1.2
Time: 30.9s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\frac{y}{\frac{a - t}{z - t}} + x\]
x + y \cdot \frac{z - t}{a - t}
\frac{y}{\frac{a - t}{z - t}} + x
double f(double x, double y, double z, double t, double a) {
        double r357224 = x;
        double r357225 = y;
        double r357226 = z;
        double r357227 = t;
        double r357228 = r357226 - r357227;
        double r357229 = a;
        double r357230 = r357229 - r357227;
        double r357231 = r357228 / r357230;
        double r357232 = r357225 * r357231;
        double r357233 = r357224 + r357232;
        return r357233;
}

double f(double x, double y, double z, double t, double a) {
        double r357234 = y;
        double r357235 = a;
        double r357236 = t;
        double r357237 = r357235 - r357236;
        double r357238 = z;
        double r357239 = r357238 - r357236;
        double r357240 = r357237 / r357239;
        double r357241 = r357234 / r357240;
        double r357242 = x;
        double r357243 = r357241 + r357242;
        return r357243;
}

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

Original1.3
Target0.4
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;y \lt -8.50808486055124107 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.8944268627920891 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Initial program 1.3

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Using strategy rm
  3. Applied clear-num1.3

    \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}}\]
  4. Using strategy rm
  5. Applied pow11.3

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

    \[\leadsto x + \color{blue}{{y}^{1}} \cdot {\left(\frac{1}{\frac{a - t}{z - t}}\right)}^{1}\]
  7. Applied pow-prod-down1.3

    \[\leadsto x + \color{blue}{{\left(y \cdot \frac{1}{\frac{a - t}{z - t}}\right)}^{1}}\]
  8. Simplified1.2

    \[\leadsto x + {\color{blue}{\left(\frac{y}{\frac{a - t}{z - t}}\right)}}^{1}\]
  9. Final simplification1.2

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

Reproduce

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

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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