Average Error: 14.5 → 9.4
Time: 21.8s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.138004103461379753600483158095185742352 \cdot 10^{-171}:\\ \;\;\;\;x + \left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)\\ \mathbf{elif}\;a \le 8.000849816726042581110534951132171577046 \cdot 10^{-162}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z} + t\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -1.138004103461379753600483158095185742352 \cdot 10^{-171}:\\
\;\;\;\;x + \left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)\\

\mathbf{elif}\;a \le 8.000849816726042581110534951132171577046 \cdot 10^{-162}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z} + t\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r5170310 = x;
        double r5170311 = y;
        double r5170312 = z;
        double r5170313 = r5170311 - r5170312;
        double r5170314 = t;
        double r5170315 = r5170314 - r5170310;
        double r5170316 = a;
        double r5170317 = r5170316 - r5170312;
        double r5170318 = r5170315 / r5170317;
        double r5170319 = r5170313 * r5170318;
        double r5170320 = r5170310 + r5170319;
        return r5170320;
}

double f(double x, double y, double z, double t, double a) {
        double r5170321 = a;
        double r5170322 = -1.1380041034613798e-171;
        bool r5170323 = r5170321 <= r5170322;
        double r5170324 = x;
        double r5170325 = 1.0;
        double r5170326 = z;
        double r5170327 = r5170321 - r5170326;
        double r5170328 = r5170325 / r5170327;
        double r5170329 = y;
        double r5170330 = r5170329 - r5170326;
        double r5170331 = r5170328 * r5170330;
        double r5170332 = t;
        double r5170333 = r5170332 - r5170324;
        double r5170334 = r5170331 * r5170333;
        double r5170335 = r5170324 + r5170334;
        double r5170336 = 8.000849816726043e-162;
        bool r5170337 = r5170321 <= r5170336;
        double r5170338 = r5170333 / r5170327;
        double r5170339 = r5170329 * r5170338;
        double r5170340 = r5170339 + r5170332;
        double r5170341 = r5170337 ? r5170340 : r5170335;
        double r5170342 = r5170323 ? r5170335 : r5170341;
        return r5170342;
}

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

Derivation

  1. Split input into 2 regimes
  2. if a < -1.1380041034613798e-171 or 8.000849816726043e-162 < a

    1. Initial program 11.9

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Simplified11.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)}\]
    3. Using strategy rm
    4. Applied fma-udef11.9

      \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(y - z\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv12.0

      \[\leadsto \color{blue}{\left(\left(t - x\right) \cdot \frac{1}{a - z}\right)} \cdot \left(y - z\right) + x\]
    7. Applied associate-*l*9.7

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

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{y - z}{a - z}} + x\]
    9. Using strategy rm
    10. Applied div-inv9.7

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

    if -1.1380041034613798e-171 < a < 8.000849816726043e-162

    1. Initial program 24.9

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Simplified24.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)}\]
    3. Using strategy rm
    4. Applied fma-udef24.9

      \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(y - z\right) + x}\]
    5. Using strategy rm
    6. Applied sub-neg24.9

      \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{\left(y + \left(-z\right)\right)} + x\]
    7. Applied distribute-lft-in24.9

      \[\leadsto \color{blue}{\left(\frac{t - x}{a - z} \cdot y + \frac{t - x}{a - z} \cdot \left(-z\right)\right)} + x\]
    8. Applied associate-+l+17.9

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

      \[\leadsto \frac{t - x}{a - z} \cdot y + \color{blue}{\left(x - z \cdot \frac{t - x}{a - z}\right)}\]
    10. Taylor expanded around inf 8.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.138004103461379753600483158095185742352 \cdot 10^{-171}:\\ \;\;\;\;x + \left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)\\ \mathbf{elif}\;a \le 8.000849816726042581110534951132171577046 \cdot 10^{-162}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z} + t\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019192 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  (+ x (* (- y z) (/ (- t x) (- a z)))))