Average Error: 25.0 → 10.3
Time: 5.5s
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 r697413 = x;
        double r697414 = y;
        double r697415 = r697414 - r697413;
        double r697416 = z;
        double r697417 = t;
        double r697418 = r697416 - r697417;
        double r697419 = r697415 * r697418;
        double r697420 = a;
        double r697421 = r697420 - r697417;
        double r697422 = r697419 / r697421;
        double r697423 = r697413 + r697422;
        return r697423;
}

double f(double x, double y, double z, double t, double a) {
        double r697424 = a;
        double r697425 = -4.28726696790774e-126;
        bool r697426 = r697424 <= r697425;
        double r697427 = x;
        double r697428 = y;
        double r697429 = r697428 - r697427;
        double r697430 = 1.0;
        double r697431 = t;
        double r697432 = r697424 - r697431;
        double r697433 = z;
        double r697434 = r697433 - r697431;
        double r697435 = r697432 / r697434;
        double r697436 = r697430 / r697435;
        double r697437 = r697429 * r697436;
        double r697438 = r697427 + r697437;
        double r697439 = 7.036096742264169e-181;
        bool r697440 = r697424 <= r697439;
        double r697441 = r697427 * r697433;
        double r697442 = r697441 / r697431;
        double r697443 = r697428 + r697442;
        double r697444 = r697433 * r697428;
        double r697445 = r697444 / r697431;
        double r697446 = r697443 - r697445;
        double r697447 = r697435 / r697429;
        double r697448 = r697430 / r697447;
        double r697449 = r697427 + r697448;
        double r697450 = r697440 ? r697446 : r697449;
        double r697451 = r697426 ? r697438 : r697450;
        return r697451;
}

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))))