Average Error: 24.0 → 10.4
Time: 7.4s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.063037459851844405024090614494773082315 \cdot 10^{-164}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \le 1.360755171575648182306418783976230335357 \cdot 10^{-139}:\\ \;\;\;\;\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 -7.063037459851844405024090614494773082315 \cdot 10^{-164}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\

\mathbf{elif}\;a \le 1.360755171575648182306418783976230335357 \cdot 10^{-139}:\\
\;\;\;\;\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 r686549 = x;
        double r686550 = y;
        double r686551 = r686550 - r686549;
        double r686552 = z;
        double r686553 = t;
        double r686554 = r686552 - r686553;
        double r686555 = r686551 * r686554;
        double r686556 = a;
        double r686557 = r686556 - r686553;
        double r686558 = r686555 / r686557;
        double r686559 = r686549 + r686558;
        return r686559;
}

double f(double x, double y, double z, double t, double a) {
        double r686560 = a;
        double r686561 = -7.063037459851844e-164;
        bool r686562 = r686560 <= r686561;
        double r686563 = x;
        double r686564 = y;
        double r686565 = r686564 - r686563;
        double r686566 = z;
        double r686567 = t;
        double r686568 = r686566 - r686567;
        double r686569 = r686560 - r686567;
        double r686570 = r686568 / r686569;
        double r686571 = r686565 * r686570;
        double r686572 = r686563 + r686571;
        double r686573 = 1.3607551715756482e-139;
        bool r686574 = r686560 <= r686573;
        double r686575 = r686563 * r686566;
        double r686576 = r686575 / r686567;
        double r686577 = r686564 + r686576;
        double r686578 = r686566 * r686564;
        double r686579 = r686578 / r686567;
        double r686580 = r686577 - r686579;
        double r686581 = 1.0;
        double r686582 = r686569 / r686568;
        double r686583 = r686582 / r686565;
        double r686584 = r686581 / r686583;
        double r686585 = r686563 + r686584;
        double r686586 = r686574 ? r686580 : r686585;
        double r686587 = r686562 ? r686572 : r686586;
        return r686587;
}

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

Original24.0
Target9.5
Herbie10.4
\[\begin{array}{l} \mathbf{if}\;a \lt -1.615306284544257464183904494091872805513 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \lt 3.774403170083174201868024161554637965035 \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 < -7.063037459851844e-164

    1. Initial program 23.3

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

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

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

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

    if -7.063037459851844e-164 < a < 1.3607551715756482e-139

    1. Initial program 29.1

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

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

    if 1.3607551715756482e-139 < a

    1. Initial program 21.8

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -7.063037459851844405024090614494773082315 \cdot 10^{-164}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \le 1.360755171575648182306418783976230335357 \cdot 10^{-139}:\\ \;\;\;\;\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 2019356 
(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))))