Average Error: 14.5 → 10.2
Time: 6.2s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -9.10172271534405112 \cdot 10^{-129} \lor \neg \left(a \le 2.7208315653629824 \cdot 10^{-146}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}}, \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{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 -9.10172271534405112 \cdot 10^{-129} \lor \neg \left(a \le 2.7208315653629824 \cdot 10^{-146}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}}, \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{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 r116551 = x;
        double r116552 = y;
        double r116553 = z;
        double r116554 = r116552 - r116553;
        double r116555 = t;
        double r116556 = r116555 - r116551;
        double r116557 = a;
        double r116558 = r116557 - r116553;
        double r116559 = r116556 / r116558;
        double r116560 = r116554 * r116559;
        double r116561 = r116551 + r116560;
        return r116561;
}

double f(double x, double y, double z, double t, double a) {
        double r116562 = a;
        double r116563 = -9.101722715344051e-129;
        bool r116564 = r116562 <= r116563;
        double r116565 = 2.7208315653629824e-146;
        bool r116566 = r116562 <= r116565;
        double r116567 = !r116566;
        bool r116568 = r116564 || r116567;
        double r116569 = y;
        double r116570 = z;
        double r116571 = r116569 - r116570;
        double r116572 = cbrt(r116571);
        double r116573 = r116572 * r116572;
        double r116574 = r116562 - r116570;
        double r116575 = cbrt(r116574);
        double r116576 = r116573 / r116575;
        double r116577 = r116572 / r116575;
        double r116578 = t;
        double r116579 = x;
        double r116580 = r116578 - r116579;
        double r116581 = r116580 / r116575;
        double r116582 = r116577 * r116581;
        double r116583 = fma(r116576, r116582, r116579);
        double r116584 = r116579 / r116570;
        double r116585 = r116578 / r116570;
        double r116586 = r116584 - r116585;
        double r116587 = fma(r116569, r116586, r116578);
        double r116588 = r116568 ? r116583 : r116587;
        return r116588;
}

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 < -9.101722715344051e-129 or 2.7208315653629824e-146 < a

    1. Initial program 11.6

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

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

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

      \[\leadsto \left(y - z\right) \cdot \frac{t - x}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}} + x\]
    7. Applied *-un-lft-identity12.1

      \[\leadsto \left(y - z\right) \cdot \frac{\color{blue}{1 \cdot \left(t - x\right)}}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}} + x\]
    8. Applied times-frac12.1

      \[\leadsto \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)} + x\]
    9. Applied associate-*r*10.1

      \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\right) \cdot \frac{t - x}{\sqrt[3]{a - z}}} + x\]
    10. Simplified10.0

      \[\leadsto \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}} + x\]
    11. Using strategy rm
    12. Applied add-cube-cbrt10.0

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}} + x\]
    13. Applied times-frac10.0

      \[\leadsto \color{blue}{\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)} \cdot \frac{t - x}{\sqrt[3]{a - z}} + x\]
    14. Applied associate-*l*9.9

      \[\leadsto \color{blue}{\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)} + x\]
    15. Using strategy rm
    16. Applied fma-def9.8

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

    if -9.101722715344051e-129 < a < 2.7208315653629824e-146

    1. Initial program 23.5

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -9.10172271534405112 \cdot 10^{-129} \lor \neg \left(a \le 2.7208315653629824 \cdot 10^{-146}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}}, \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020089 +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)))))