Average Error: 1.3 → 1.0
Time: 18.2s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le 3.91409457080451341356217564049176136337 \cdot 10^{-265}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\ \mathbf{elif}\;y \le 1.277502191388937042011677378683335089821 \cdot 10^{-82}:\\ \;\;\;\;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 3.91409457080451341356217564049176136337 \cdot 10^{-265}:\\
\;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\

\mathbf{elif}\;y \le 1.277502191388937042011677378683335089821 \cdot 10^{-82}:\\
\;\;\;\;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 r27630387 = x;
        double r27630388 = y;
        double r27630389 = z;
        double r27630390 = t;
        double r27630391 = r27630389 - r27630390;
        double r27630392 = a;
        double r27630393 = r27630392 - r27630390;
        double r27630394 = r27630391 / r27630393;
        double r27630395 = r27630388 * r27630394;
        double r27630396 = r27630387 + r27630395;
        return r27630396;
}

double f(double x, double y, double z, double t, double a) {
        double r27630397 = y;
        double r27630398 = 3.9140945708045134e-265;
        bool r27630399 = r27630397 <= r27630398;
        double r27630400 = x;
        double r27630401 = 1.0;
        double r27630402 = a;
        double r27630403 = t;
        double r27630404 = r27630402 - r27630403;
        double r27630405 = z;
        double r27630406 = r27630405 - r27630403;
        double r27630407 = r27630404 / r27630406;
        double r27630408 = r27630401 / r27630407;
        double r27630409 = r27630408 * r27630397;
        double r27630410 = r27630400 + r27630409;
        double r27630411 = 1.277502191388937e-82;
        bool r27630412 = r27630397 <= r27630411;
        double r27630413 = r27630406 * r27630397;
        double r27630414 = r27630413 / r27630404;
        double r27630415 = r27630400 + r27630414;
        double r27630416 = r27630412 ? r27630415 : r27630410;
        double r27630417 = r27630399 ? r27630410 : r27630416;
        return r27630417;
}

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.0
\[\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 < 3.9140945708045134e-265 or 1.277502191388937e-82 < y

    1. Initial program 1.1

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

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

    if 3.9140945708045134e-265 < y < 1.277502191388937e-82

    1. Initial program 2.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 3.91409457080451341356217564049176136337 \cdot 10^{-265}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{z - t}} \cdot y\\ \mathbf{elif}\;y \le 1.277502191388937042011677378683335089821 \cdot 10^{-82}:\\ \;\;\;\;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 2019179 
(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)))))