Average Error: 24.7 → 11.2
Time: 6.0s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.0939292470139619 \cdot 10^{-217} \lor \neg \left(a \le -2.5321159423877618 \cdot 10^{-267}\right):\\ \;\;\;\;x + \frac{y - x}{{\left(\frac{a - t}{z - t}\right)}^{1}}\\ \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 -3.0939292470139619 \cdot 10^{-217} \lor \neg \left(a \le -2.5321159423877618 \cdot 10^{-267}\right):\\
\;\;\;\;x + \frac{y - x}{{\left(\frac{a - t}{z - t}\right)}^{1}}\\

\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 r648277 = x;
        double r648278 = y;
        double r648279 = r648278 - r648277;
        double r648280 = z;
        double r648281 = t;
        double r648282 = r648280 - r648281;
        double r648283 = r648279 * r648282;
        double r648284 = a;
        double r648285 = r648284 - r648281;
        double r648286 = r648283 / r648285;
        double r648287 = r648277 + r648286;
        return r648287;
}

double f(double x, double y, double z, double t, double a) {
        double r648288 = a;
        double r648289 = -3.093929247013962e-217;
        bool r648290 = r648288 <= r648289;
        double r648291 = -2.5321159423877618e-267;
        bool r648292 = r648288 <= r648291;
        double r648293 = !r648292;
        bool r648294 = r648290 || r648293;
        double r648295 = x;
        double r648296 = y;
        double r648297 = r648296 - r648295;
        double r648298 = t;
        double r648299 = r648288 - r648298;
        double r648300 = z;
        double r648301 = r648300 - r648298;
        double r648302 = r648299 / r648301;
        double r648303 = 1.0;
        double r648304 = pow(r648302, r648303);
        double r648305 = r648297 / r648304;
        double r648306 = r648295 + r648305;
        double r648307 = r648295 * r648300;
        double r648308 = r648307 / r648298;
        double r648309 = r648296 + r648308;
        double r648310 = r648300 * r648296;
        double r648311 = r648310 / r648298;
        double r648312 = r648309 - r648311;
        double r648313 = r648294 ? r648306 : r648312;
        return r648313;
}

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.7
Target9.0
Herbie11.2
\[\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 2 regimes
  2. if a < -3.093929247013962e-217 or -2.5321159423877618e-267 < a

    1. Initial program 24.4

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

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

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

    if -3.093929247013962e-217 < a < -2.5321159423877618e-267

    1. Initial program 32.3

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

      \[\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 simplification11.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -3.0939292470139619 \cdot 10^{-217} \lor \neg \left(a \le -2.5321159423877618 \cdot 10^{-267}\right):\\ \;\;\;\;x + \frac{y - x}{{\left(\frac{a - t}{z - t}\right)}^{1}}\\ \mathbf{else}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \end{array}\]

Reproduce

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