Average Error: 25.2 → 10.4
Time: 30.7s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.261774436029236207763718189638254139137 \cdot 10^{-159} \lor \neg \left(a \le 9.751786981406139490176078019148750964763 \cdot 10^{-141}\right):\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z - t} - \frac{t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -7.261774436029236207763718189638254139137 \cdot 10^{-159} \lor \neg \left(a \le 9.751786981406139490176078019148750964763 \cdot 10^{-141}\right):\\
\;\;\;\;x + \frac{y - x}{\frac{a}{z - t} - \frac{t}{z - t}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r412272 = x;
        double r412273 = y;
        double r412274 = r412273 - r412272;
        double r412275 = z;
        double r412276 = t;
        double r412277 = r412275 - r412276;
        double r412278 = r412274 * r412277;
        double r412279 = a;
        double r412280 = r412279 - r412276;
        double r412281 = r412278 / r412280;
        double r412282 = r412272 + r412281;
        return r412282;
}

double f(double x, double y, double z, double t, double a) {
        double r412283 = a;
        double r412284 = -7.261774436029236e-159;
        bool r412285 = r412283 <= r412284;
        double r412286 = 9.75178698140614e-141;
        bool r412287 = r412283 <= r412286;
        double r412288 = !r412287;
        bool r412289 = r412285 || r412288;
        double r412290 = x;
        double r412291 = y;
        double r412292 = r412291 - r412290;
        double r412293 = z;
        double r412294 = t;
        double r412295 = r412293 - r412294;
        double r412296 = r412283 / r412295;
        double r412297 = r412294 / r412295;
        double r412298 = r412296 - r412297;
        double r412299 = r412292 / r412298;
        double r412300 = r412290 + r412299;
        double r412301 = r412290 * r412293;
        double r412302 = r412301 / r412294;
        double r412303 = r412291 + r412302;
        double r412304 = r412293 * r412291;
        double r412305 = r412304 / r412294;
        double r412306 = r412303 - r412305;
        double r412307 = r412289 ? r412300 : r412306;
        return r412307;
}

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.4
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 2 regimes
  2. if a < -7.261774436029236e-159 or 9.75178698140614e-141 < a

    1. Initial program 23.9

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

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

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

    if -7.261774436029236e-159 < a < 9.75178698140614e-141

    1. Initial program 29.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -7.261774436029236207763718189638254139137 \cdot 10^{-159} \lor \neg \left(a \le 9.751786981406139490176078019148750964763 \cdot 10^{-141}\right):\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z - t} - \frac{t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \end{array}\]

Reproduce

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