Average Error: 25.2 → 10.5
Time: 28.7s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.85925241219433013420020968270754857507 \cdot 10^{-145}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \le 4.817774934231587927443345859010053721242 \cdot 10^{-234}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z - t} - \frac{t}{z - t}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -3.85925241219433013420020968270754857507 \cdot 10^{-145}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r528319 = x;
        double r528320 = y;
        double r528321 = r528320 - r528319;
        double r528322 = z;
        double r528323 = t;
        double r528324 = r528322 - r528323;
        double r528325 = r528321 * r528324;
        double r528326 = a;
        double r528327 = r528326 - r528323;
        double r528328 = r528325 / r528327;
        double r528329 = r528319 + r528328;
        return r528329;
}

double f(double x, double y, double z, double t, double a) {
        double r528330 = a;
        double r528331 = -3.85925241219433e-145;
        bool r528332 = r528330 <= r528331;
        double r528333 = x;
        double r528334 = y;
        double r528335 = r528334 - r528333;
        double r528336 = z;
        double r528337 = t;
        double r528338 = r528336 - r528337;
        double r528339 = r528330 - r528337;
        double r528340 = r528338 / r528339;
        double r528341 = r528335 * r528340;
        double r528342 = r528333 + r528341;
        double r528343 = 4.817774934231588e-234;
        bool r528344 = r528330 <= r528343;
        double r528345 = r528333 * r528336;
        double r528346 = r528345 / r528337;
        double r528347 = r528334 + r528346;
        double r528348 = r528336 * r528334;
        double r528349 = r528348 / r528337;
        double r528350 = r528347 - r528349;
        double r528351 = r528330 / r528338;
        double r528352 = r528337 / r528338;
        double r528353 = r528351 - r528352;
        double r528354 = r528335 / r528353;
        double r528355 = r528333 + r528354;
        double r528356 = r528344 ? r528350 : r528355;
        double r528357 = r528332 ? r528342 : r528356;
        return r528357;
}

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.2
Target9.6
Herbie10.5
\[\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 < -3.85925241219433e-145

    1. Initial program 23.9

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

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

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

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

    if -3.85925241219433e-145 < a < 4.817774934231588e-234

    1. Initial program 31.1

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

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

    if 4.817774934231588e-234 < a

    1. Initial program 24.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -3.85925241219433013420020968270754857507 \cdot 10^{-145}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \le 4.817774934231587927443345859010053721242 \cdot 10^{-234}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z - t} - \frac{t}{z - t}}\\ \end{array}\]

Reproduce

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