Average Error: 14.7 → 9.7
Time: 21.7s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.4167661692054223 \cdot 10^{-133}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}, x\right)\\ \mathbf{elif}\;a \le 1.3917837591469568 \cdot 10^{-93}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}, x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -3.4167661692054223 \cdot 10^{-133}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}, x\right)\\

\mathbf{elif}\;a \le 1.3917837591469568 \cdot 10^{-93}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}, x\right)\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r4902107 = x;
        double r4902108 = y;
        double r4902109 = z;
        double r4902110 = r4902108 - r4902109;
        double r4902111 = t;
        double r4902112 = r4902111 - r4902107;
        double r4902113 = a;
        double r4902114 = r4902113 - r4902109;
        double r4902115 = r4902112 / r4902114;
        double r4902116 = r4902110 * r4902115;
        double r4902117 = r4902107 + r4902116;
        return r4902117;
}

double f(double x, double y, double z, double t, double a) {
        double r4902118 = a;
        double r4902119 = -3.4167661692054223e-133;
        bool r4902120 = r4902118 <= r4902119;
        double r4902121 = y;
        double r4902122 = z;
        double r4902123 = r4902121 - r4902122;
        double r4902124 = r4902118 - r4902122;
        double r4902125 = cbrt(r4902124);
        double r4902126 = t;
        double r4902127 = x;
        double r4902128 = r4902126 - r4902127;
        double r4902129 = cbrt(r4902128);
        double r4902130 = r4902125 / r4902129;
        double r4902131 = r4902130 * r4902130;
        double r4902132 = r4902123 / r4902131;
        double r4902133 = r4902129 / r4902125;
        double r4902134 = fma(r4902132, r4902133, r4902127);
        double r4902135 = 1.3917837591469568e-93;
        bool r4902136 = r4902118 <= r4902135;
        double r4902137 = r4902127 / r4902122;
        double r4902138 = r4902126 / r4902122;
        double r4902139 = r4902137 - r4902138;
        double r4902140 = fma(r4902121, r4902139, r4902126);
        double r4902141 = r4902136 ? r4902140 : r4902134;
        double r4902142 = r4902120 ? r4902134 : r4902141;
        return r4902142;
}

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 < -3.4167661692054223e-133 or 1.3917837591469568e-93 < a

    1. Initial program 10.7

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

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

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

      \[\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-cbrt11.4

      \[\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-frac11.4

      \[\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*9.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. Simplified9.1

      \[\leadsto \color{blue}{\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + x\]
    11. Using strategy rm
    12. Applied fma-def9.1

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

    if -3.4167661692054223e-133 < a < 1.3917837591469568e-93

    1. Initial program 24.8

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

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

      \[\leadsto \color{blue}{\left(t + \frac{x \cdot y}{z}\right) - \frac{t \cdot y}{z}}\]
    4. Simplified11.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 simplification9.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -3.4167661692054223 \cdot 10^{-133}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}, x\right)\\ \mathbf{elif}\;a \le 1.3917837591469568 \cdot 10^{-93}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}, x\right)\\ \end{array}\]

Reproduce

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