Average Error: 1.2 → 0.6
Time: 19.0s
Precision: 64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;y \le -3.078524461247924666734264090540732032625 \cdot 10^{-75}:\\ \;\;\;\;\frac{z - t}{z - a} \cdot y + x\\ \mathbf{elif}\;y \le 2.370420785364424735906302326534090638929 \cdot 10^{-168}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\ \mathbf{else}:\\ \;\;\;\;\frac{z - t}{z - a} \cdot y + x\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;y \le -3.078524461247924666734264090540732032625 \cdot 10^{-75}:\\
\;\;\;\;\frac{z - t}{z - a} \cdot y + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r27695338 = x;
        double r27695339 = y;
        double r27695340 = z;
        double r27695341 = t;
        double r27695342 = r27695340 - r27695341;
        double r27695343 = a;
        double r27695344 = r27695340 - r27695343;
        double r27695345 = r27695342 / r27695344;
        double r27695346 = r27695339 * r27695345;
        double r27695347 = r27695338 + r27695346;
        return r27695347;
}

double f(double x, double y, double z, double t, double a) {
        double r27695348 = y;
        double r27695349 = -3.0785244612479247e-75;
        bool r27695350 = r27695348 <= r27695349;
        double r27695351 = z;
        double r27695352 = t;
        double r27695353 = r27695351 - r27695352;
        double r27695354 = a;
        double r27695355 = r27695351 - r27695354;
        double r27695356 = r27695353 / r27695355;
        double r27695357 = r27695356 * r27695348;
        double r27695358 = x;
        double r27695359 = r27695357 + r27695358;
        double r27695360 = 2.3704207853644247e-168;
        bool r27695361 = r27695348 <= r27695360;
        double r27695362 = r27695348 * r27695353;
        double r27695363 = 1.0;
        double r27695364 = r27695363 / r27695355;
        double r27695365 = r27695362 * r27695364;
        double r27695366 = r27695358 + r27695365;
        double r27695367 = r27695361 ? r27695366 : r27695359;
        double r27695368 = r27695350 ? r27695359 : r27695367;
        return r27695368;
}

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.2
Target1.1
Herbie0.6
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -3.0785244612479247e-75 or 2.3704207853644247e-168 < y

    1. Initial program 0.7

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

    if -3.0785244612479247e-75 < y < 2.3704207853644247e-168

    1. Initial program 2.3

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

      \[\leadsto x + y \cdot \color{blue}{\left(\left(z - t\right) \cdot \frac{1}{z - a}\right)}\]
    4. Applied associate-*r*0.5

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

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

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

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