Average Error: 1.5 → 0.6
Time: 20.2s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -320690.351892832317389547824859619140625:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\ \mathbf{elif}\;y \le 4.646441977933500385025204193605670970496 \cdot 10^{-115}:\\ \;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\ \end{array}\]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -320690.351892832317389547824859619140625:\\
\;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\

\mathbf{elif}\;y \le 4.646441977933500385025204193605670970496 \cdot 10^{-115}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r28821424 = x;
        double r28821425 = y;
        double r28821426 = z;
        double r28821427 = t;
        double r28821428 = r28821426 - r28821427;
        double r28821429 = a;
        double r28821430 = r28821429 - r28821427;
        double r28821431 = r28821428 / r28821430;
        double r28821432 = r28821425 * r28821431;
        double r28821433 = r28821424 + r28821432;
        return r28821433;
}

double f(double x, double y, double z, double t, double a) {
        double r28821434 = y;
        double r28821435 = -320690.3518928323;
        bool r28821436 = r28821434 <= r28821435;
        double r28821437 = x;
        double r28821438 = 1.0;
        double r28821439 = a;
        double r28821440 = t;
        double r28821441 = r28821439 - r28821440;
        double r28821442 = z;
        double r28821443 = r28821442 - r28821440;
        double r28821444 = r28821441 / r28821443;
        double r28821445 = r28821438 / r28821444;
        double r28821446 = r28821445 * r28821434;
        double r28821447 = r28821437 + r28821446;
        double r28821448 = 4.6464419779335e-115;
        bool r28821449 = r28821434 <= r28821448;
        double r28821450 = r28821443 * r28821434;
        double r28821451 = r28821450 / r28821441;
        double r28821452 = r28821437 + r28821451;
        double r28821453 = r28821449 ? r28821452 : r28821447;
        double r28821454 = r28821436 ? r28821447 : r28821453;
        return r28821454;
}

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.5
Target0.5
Herbie0.6
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241069024247453646278348229 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \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. Split input into 2 regimes
  2. if y < -320690.3518928323 or 4.6464419779335e-115 < y

    1. Initial program 0.6

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

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

    if -320690.3518928323 < y < 4.6464419779335e-115

    1. Initial program 2.7

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied associate-*r/0.3

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -320690.351892832317389547824859619140625:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\ \mathbf{elif}\;y \le 4.646441977933500385025204193605670970496 \cdot 10^{-115}:\\ \;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\ \end{array}\]

Reproduce

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