Average Error: 14.4 → 10.8
Time: 5.6s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.3755603769615804 \cdot 10^{-35} \lor \neg \left(a \le 1.9946576783558662 \cdot 10^{-73}\right):\\ \;\;\;\;\mathsf{fma}\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}, \frac{\sqrt[3]{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 -7.3755603769615804 \cdot 10^{-35} \lor \neg \left(a \le 1.9946576783558662 \cdot 10^{-73}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}, \frac{\sqrt[3]{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 r137991 = x;
        double r137992 = y;
        double r137993 = z;
        double r137994 = r137992 - r137993;
        double r137995 = t;
        double r137996 = r137995 - r137991;
        double r137997 = a;
        double r137998 = r137997 - r137993;
        double r137999 = r137996 / r137998;
        double r138000 = r137994 * r137999;
        double r138001 = r137991 + r138000;
        return r138001;
}

double f(double x, double y, double z, double t, double a) {
        double r138002 = a;
        double r138003 = -7.37556037696158e-35;
        bool r138004 = r138002 <= r138003;
        double r138005 = 1.9946576783558662e-73;
        bool r138006 = r138002 <= r138005;
        double r138007 = !r138006;
        bool r138008 = r138004 || r138007;
        double r138009 = y;
        double r138010 = z;
        double r138011 = r138009 - r138010;
        double r138012 = t;
        double r138013 = x;
        double r138014 = r138012 - r138013;
        double r138015 = cbrt(r138014);
        double r138016 = r138015 * r138015;
        double r138017 = r138002 - r138010;
        double r138018 = cbrt(r138017);
        double r138019 = r138018 * r138018;
        double r138020 = r138016 / r138019;
        double r138021 = r138011 * r138020;
        double r138022 = r138015 / r138018;
        double r138023 = fma(r138021, r138022, r138013);
        double r138024 = r138013 / r138010;
        double r138025 = r138012 / r138010;
        double r138026 = r138024 - r138025;
        double r138027 = fma(r138009, r138026, r138012);
        double r138028 = r138008 ? r138023 : r138027;
        return r138028;
}

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 < -7.37556037696158e-35 or 1.9946576783558662e-73 < a

    1. Initial program 9.4

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

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

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

      \[\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 add-cube-cbrt10.0

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

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

      \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}} + x\]
    10. Using strategy rm
    11. Applied fma-def8.0

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

    if -7.37556037696158e-35 < a < 1.9946576783558662e-73

    1. Initial program 23.0

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

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

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

      \[\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.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -7.3755603769615804 \cdot 10^{-35} \lor \neg \left(a \le 1.9946576783558662 \cdot 10^{-73}\right):\\ \;\;\;\;\mathsf{fma}\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}, \frac{\sqrt[3]{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 2020027 +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)))))