Average Error: 14.8 → 11.5
Time: 4.2s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.0923027359928953 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{1}{\frac{a - z}{t - x}}, x\right)\\ \mathbf{elif}\;a \le 5.3740921984571959 \cdot 10^{-62}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right) + x\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -1.0923027359928953 \cdot 10^{-112}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{1}{\frac{a - z}{t - x}}, x\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r93138 = x;
        double r93139 = y;
        double r93140 = z;
        double r93141 = r93139 - r93140;
        double r93142 = t;
        double r93143 = r93142 - r93138;
        double r93144 = a;
        double r93145 = r93144 - r93140;
        double r93146 = r93143 / r93145;
        double r93147 = r93141 * r93146;
        double r93148 = r93138 + r93147;
        return r93148;
}

double f(double x, double y, double z, double t, double a) {
        double r93149 = a;
        double r93150 = -1.0923027359928953e-112;
        bool r93151 = r93149 <= r93150;
        double r93152 = y;
        double r93153 = z;
        double r93154 = r93152 - r93153;
        double r93155 = 1.0;
        double r93156 = r93149 - r93153;
        double r93157 = t;
        double r93158 = x;
        double r93159 = r93157 - r93158;
        double r93160 = r93156 / r93159;
        double r93161 = r93155 / r93160;
        double r93162 = fma(r93154, r93161, r93158);
        double r93163 = 5.374092198457196e-62;
        bool r93164 = r93149 <= r93163;
        double r93165 = r93158 / r93153;
        double r93166 = r93157 / r93153;
        double r93167 = r93165 - r93166;
        double r93168 = fma(r93152, r93167, r93157);
        double r93169 = r93155 / r93156;
        double r93170 = r93159 * r93169;
        double r93171 = r93154 * r93170;
        double r93172 = r93171 + r93158;
        double r93173 = r93164 ? r93168 : r93172;
        double r93174 = r93151 ? r93162 : r93173;
        return r93174;
}

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 3 regimes
  2. if a < -1.0923027359928953e-112

    1. Initial program 10.6

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

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

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

    if -1.0923027359928953e-112 < a < 5.374092198457196e-62

    1. Initial program 24.1

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

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

    if 5.374092198457196e-62 < a

    1. Initial program 10.1

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

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

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

      \[\leadsto \left(y - z\right) \cdot \color{blue}{\left(\left(t - x\right) \cdot \frac{1}{a - z}\right)} + x\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.0923027359928953 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{1}{\frac{a - z}{t - x}}, x\right)\\ \mathbf{elif}\;a \le 5.3740921984571959 \cdot 10^{-62}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right) + x\\ \end{array}\]

Reproduce

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