Average Error: 23.4 → 10.4
Time: 5.3s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -6.67116262087789056267941985149513120555 \cdot 10^{-184}:\\ \;\;\;\;x + \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{y - x}}} \cdot \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t}}{z - t}}\\ \mathbf{elif}\;a \le 2.379494482182929201880307111811788785007 \cdot 10^{-88}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -6.67116262087789056267941985149513120555 \cdot 10^{-184}:\\
\;\;\;\;x + \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{y - x}}} \cdot \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t}}{z - t}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r831511 = x;
        double r831512 = y;
        double r831513 = r831512 - r831511;
        double r831514 = z;
        double r831515 = t;
        double r831516 = r831514 - r831515;
        double r831517 = r831513 * r831516;
        double r831518 = a;
        double r831519 = r831518 - r831515;
        double r831520 = r831517 / r831519;
        double r831521 = r831511 + r831520;
        return r831521;
}

double f(double x, double y, double z, double t, double a) {
        double r831522 = a;
        double r831523 = -6.671162620877891e-184;
        bool r831524 = r831522 <= r831523;
        double r831525 = x;
        double r831526 = y;
        double r831527 = r831526 - r831525;
        double r831528 = cbrt(r831527);
        double r831529 = t;
        double r831530 = r831522 - r831529;
        double r831531 = cbrt(r831530);
        double r831532 = r831531 * r831531;
        double r831533 = r831532 / r831528;
        double r831534 = r831528 / r831533;
        double r831535 = z;
        double r831536 = r831535 - r831529;
        double r831537 = r831531 / r831536;
        double r831538 = r831528 / r831537;
        double r831539 = r831534 * r831538;
        double r831540 = r831525 + r831539;
        double r831541 = 2.3794944821829292e-88;
        bool r831542 = r831522 <= r831541;
        double r831543 = r831525 * r831535;
        double r831544 = r831543 / r831529;
        double r831545 = r831526 + r831544;
        double r831546 = r831535 * r831526;
        double r831547 = r831546 / r831529;
        double r831548 = r831545 - r831547;
        double r831549 = r831536 / r831530;
        double r831550 = r831527 * r831549;
        double r831551 = r831525 + r831550;
        double r831552 = r831542 ? r831548 : r831551;
        double r831553 = r831524 ? r831540 : r831552;
        return r831553;
}

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

Original23.4
Target9.0
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 < -6.671162620877891e-184

    1. Initial program 22.3

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity9.9

      \[\leadsto x + \frac{y - x}{\frac{a - t}{\color{blue}{1 \cdot \left(z - t\right)}}}\]
    6. Applied add-cube-cbrt10.5

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

      \[\leadsto x + \frac{y - x}{\color{blue}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{1} \cdot \frac{\sqrt[3]{a - t}}{z - t}}}\]
    8. Applied add-cube-cbrt10.7

      \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \sqrt[3]{y - x}}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{1} \cdot \frac{\sqrt[3]{a - t}}{z - t}}\]
    9. Applied times-frac10.3

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{1}} \cdot \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t}}{z - t}}}\]
    10. Simplified10.3

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

    if -6.671162620877891e-184 < a < 2.3794944821829292e-88

    1. Initial program 28.6

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

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

    if 2.3794944821829292e-88 < a

    1. Initial program 21.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -6.67116262087789056267941985149513120555 \cdot 10^{-184}:\\ \;\;\;\;x + \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{y - x}}} \cdot \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t}}{z - t}}\\ \mathbf{elif}\;a \le 2.379494482182929201880307111811788785007 \cdot 10^{-88}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\ \end{array}\]

Reproduce

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