Average Error: 14.8 → 10.2
Time: 4.8s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -9.88656814146117223 \cdot 10^{-154} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.73247773315875748 \cdot 10^{-210}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \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}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -9.88656814146117223 \cdot 10^{-154} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.73247773315875748 \cdot 10^{-210}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\

\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 r117413 = x;
        double r117414 = y;
        double r117415 = z;
        double r117416 = r117414 - r117415;
        double r117417 = t;
        double r117418 = r117417 - r117413;
        double r117419 = a;
        double r117420 = r117419 - r117415;
        double r117421 = r117418 / r117420;
        double r117422 = r117416 * r117421;
        double r117423 = r117413 + r117422;
        return r117423;
}

double f(double x, double y, double z, double t, double a) {
        double r117424 = x;
        double r117425 = y;
        double r117426 = z;
        double r117427 = r117425 - r117426;
        double r117428 = t;
        double r117429 = r117428 - r117424;
        double r117430 = a;
        double r117431 = r117430 - r117426;
        double r117432 = r117429 / r117431;
        double r117433 = r117427 * r117432;
        double r117434 = r117424 + r117433;
        double r117435 = -9.886568141461172e-154;
        bool r117436 = r117434 <= r117435;
        double r117437 = 4.7324777331587575e-210;
        bool r117438 = r117434 <= r117437;
        double r117439 = !r117438;
        bool r117440 = r117436 || r117439;
        double r117441 = r117424 / r117426;
        double r117442 = r117428 / r117426;
        double r117443 = r117441 - r117442;
        double r117444 = fma(r117425, r117443, r117428);
        double r117445 = r117440 ? r117434 : r117444;
        return r117445;
}

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 (+ x (* (- y z) (/ (- t x) (- a z)))) < -9.886568141461172e-154 or 4.7324777331587575e-210 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 6.1

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

    if -9.886568141461172e-154 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 4.7324777331587575e-210

    1. Initial program 50.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -9.88656814146117223 \cdot 10^{-154} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.73247773315875748 \cdot 10^{-210}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]

Reproduce

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