Average Error: 25.0 → 10.3
Time: 13.0s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -4.2872669679077402 \cdot 10^{-126}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{1}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;a \le 7.03609674226416858 \cdot 10^{-181}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{\frac{a - t}{z - t}}{y - x}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -4.2872669679077402 \cdot 10^{-126}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{1}{\frac{a - t}{z - t}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r3358 = x;
        double r3359 = y;
        double r3360 = r3359 - r3358;
        double r3361 = z;
        double r3362 = t;
        double r3363 = r3361 - r3362;
        double r3364 = r3360 * r3363;
        double r3365 = a;
        double r3366 = r3365 - r3362;
        double r3367 = r3364 / r3366;
        double r3368 = r3358 + r3367;
        return r3368;
}

double f(double x, double y, double z, double t, double a) {
        double r3369 = a;
        double r3370 = -4.28726696790774e-126;
        bool r3371 = r3369 <= r3370;
        double r3372 = x;
        double r3373 = y;
        double r3374 = r3373 - r3372;
        double r3375 = 1.0;
        double r3376 = t;
        double r3377 = r3369 - r3376;
        double r3378 = z;
        double r3379 = r3378 - r3376;
        double r3380 = r3377 / r3379;
        double r3381 = r3375 / r3380;
        double r3382 = r3374 * r3381;
        double r3383 = r3372 + r3382;
        double r3384 = 7.036096742264169e-181;
        bool r3385 = r3369 <= r3384;
        double r3386 = r3372 * r3378;
        double r3387 = r3386 / r3376;
        double r3388 = r3373 + r3387;
        double r3389 = r3378 * r3373;
        double r3390 = r3389 / r3376;
        double r3391 = r3388 - r3390;
        double r3392 = r3380 / r3374;
        double r3393 = r3375 / r3392;
        double r3394 = r3372 + r3393;
        double r3395 = r3385 ? r3391 : r3394;
        double r3396 = r3371 ? r3383 : r3395;
        return r3396;
}

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

Original25.0
Target9.3
Herbie10.3
\[\begin{array}{l} \mathbf{if}\;a \lt -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \lt 3.7744031700831742 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if a < -4.28726696790774e-126

    1. Initial program 23.6

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity23.6

      \[\leadsto x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{\color{blue}{1 \cdot \left(a - t\right)}}\]
    4. Applied times-frac9.5

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

      \[\leadsto x + \color{blue}{\left(y - x\right)} \cdot \frac{z - t}{a - t}\]
    6. Using strategy rm
    7. Applied clear-num9.6

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

    if -4.28726696790774e-126 < a < 7.036096742264169e-181

    1. Initial program 30.2

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Taylor expanded around inf 11.9

      \[\leadsto \color{blue}{\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}}\]

    if 7.036096742264169e-181 < a

    1. Initial program 23.6

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

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

      \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y - x}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.3

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

Reproduce

herbie shell --seed 2020025 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))

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