Average Error: 14.5 → 11.5
Time: 4.0s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -2.467528666021020793455120862095662849828 \cdot 10^{-148} \lor \neg \left(a \le 4.283293768185102062998626462735096461737 \cdot 10^{-64}\right):\\ \;\;\;\;\mathsf{fma}\left(y - z, 1 \cdot \frac{t - x}{a - z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -2.467528666021020793455120862095662849828 \cdot 10^{-148} \lor \neg \left(a \le 4.283293768185102062998626462735096461737 \cdot 10^{-64}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, 1 \cdot \frac{t - x}{a - z}, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r76376 = x;
        double r76377 = y;
        double r76378 = z;
        double r76379 = r76377 - r76378;
        double r76380 = t;
        double r76381 = r76380 - r76376;
        double r76382 = a;
        double r76383 = r76382 - r76378;
        double r76384 = r76381 / r76383;
        double r76385 = r76379 * r76384;
        double r76386 = r76376 + r76385;
        return r76386;
}

double f(double x, double y, double z, double t, double a) {
        double r76387 = a;
        double r76388 = -2.4675286660210208e-148;
        bool r76389 = r76387 <= r76388;
        double r76390 = 4.283293768185102e-64;
        bool r76391 = r76387 <= r76390;
        double r76392 = !r76391;
        bool r76393 = r76389 || r76392;
        double r76394 = y;
        double r76395 = z;
        double r76396 = r76394 - r76395;
        double r76397 = 1.0;
        double r76398 = t;
        double r76399 = x;
        double r76400 = r76398 - r76399;
        double r76401 = r76387 - r76395;
        double r76402 = r76400 / r76401;
        double r76403 = r76397 * r76402;
        double r76404 = fma(r76396, r76403, r76399);
        double r76405 = r76399 / r76395;
        double r76406 = r76398 / r76395;
        double r76407 = r76405 - r76406;
        double r76408 = fma(r76394, r76407, r76398);
        double r76409 = r76393 ? r76404 : r76408;
        return r76409;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Derivation

  1. Split input into 2 regimes
  2. if a < -2.4675286660210208e-148 or 4.283293768185102e-64 < a

    1. Initial program 10.5

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

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{1}{\frac{a - z}{t - x}}}, x\right)\]
    5. Using strategy rm
    6. Applied *-un-lft-identity10.6

      \[\leadsto \mathsf{fma}\left(y - z, \frac{1}{\frac{a - z}{\color{blue}{1 \cdot \left(t - x\right)}}}, x\right)\]
    7. Applied *-un-lft-identity10.6

      \[\leadsto \mathsf{fma}\left(y - z, \frac{1}{\frac{\color{blue}{1 \cdot \left(a - z\right)}}{1 \cdot \left(t - x\right)}}, x\right)\]
    8. Applied times-frac10.6

      \[\leadsto \mathsf{fma}\left(y - z, \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{a - z}{t - x}}}, x\right)\]
    9. Applied add-cube-cbrt10.6

      \[\leadsto \mathsf{fma}\left(y - z, \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{1}{1} \cdot \frac{a - z}{t - x}}, x\right)\]
    10. Applied times-frac10.6

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{1}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{a - z}{t - x}}}, x\right)\]
    11. Simplified10.6

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{a - z}{t - x}}, x\right)\]
    12. Simplified10.4

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

    if -2.4675286660210208e-148 < a < 4.283293768185102e-64

    1. Initial program 24.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Taylor expanded around inf 16.6

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification11.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -2.467528666021020793455120862095662849828 \cdot 10^{-148} \lor \neg \left(a \le 4.283293768185102062998626462735096461737 \cdot 10^{-64}\right):\\ \;\;\;\;\mathsf{fma}\left(y - z, 1 \cdot \frac{t - x}{a - z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]

Reproduce

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