Average Error: 14.6 → 9.9
Time: 20.6s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -2.0167221434791827 \cdot 10^{-79}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}{\frac{\sqrt[3]{a - z}}{t - x}}\\ \mathbf{elif}\;a \le 1.082916304047229 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}}, \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -2.0167221434791827 \cdot 10^{-79}:\\
\;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}{\frac{\sqrt[3]{a - z}}{t - x}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r4281639 = x;
        double r4281640 = y;
        double r4281641 = z;
        double r4281642 = r4281640 - r4281641;
        double r4281643 = t;
        double r4281644 = r4281643 - r4281639;
        double r4281645 = a;
        double r4281646 = r4281645 - r4281641;
        double r4281647 = r4281644 / r4281646;
        double r4281648 = r4281642 * r4281647;
        double r4281649 = r4281639 + r4281648;
        return r4281649;
}

double f(double x, double y, double z, double t, double a) {
        double r4281650 = a;
        double r4281651 = -2.0167221434791827e-79;
        bool r4281652 = r4281650 <= r4281651;
        double r4281653 = x;
        double r4281654 = y;
        double r4281655 = z;
        double r4281656 = r4281654 - r4281655;
        double r4281657 = r4281650 - r4281655;
        double r4281658 = cbrt(r4281657);
        double r4281659 = r4281658 * r4281658;
        double r4281660 = r4281656 / r4281659;
        double r4281661 = t;
        double r4281662 = r4281661 - r4281653;
        double r4281663 = r4281658 / r4281662;
        double r4281664 = r4281660 / r4281663;
        double r4281665 = r4281653 + r4281664;
        double r4281666 = 1.082916304047229e-175;
        bool r4281667 = r4281650 <= r4281666;
        double r4281668 = r4281653 / r4281655;
        double r4281669 = fma(r4281668, r4281654, r4281661);
        double r4281670 = r4281655 / r4281654;
        double r4281671 = r4281661 / r4281670;
        double r4281672 = r4281669 - r4281671;
        double r4281673 = 1.0;
        double r4281674 = cbrt(r4281662);
        double r4281675 = r4281674 * r4281674;
        double r4281676 = r4281659 / r4281675;
        double r4281677 = r4281673 / r4281676;
        double r4281678 = r4281658 / r4281674;
        double r4281679 = r4281656 / r4281678;
        double r4281680 = fma(r4281677, r4281679, r4281653);
        double r4281681 = r4281667 ? r4281672 : r4281680;
        double r4281682 = r4281652 ? r4281665 : r4281681;
        return r4281682;
}

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 < -2.0167221434791827e-79

    1. Initial program 10.2

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} + x\]
    8. Using strategy rm
    9. Applied *-un-lft-identity10.3

      \[\leadsto \frac{y - z}{\frac{a - z}{\color{blue}{1 \cdot \left(t - x\right)}}} + x\]
    10. Applied add-cube-cbrt10.7

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

      \[\leadsto \frac{y - z}{\color{blue}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{1} \cdot \frac{\sqrt[3]{a - z}}{t - x}}} + x\]
    12. Applied associate-/r*8.5

      \[\leadsto \color{blue}{\frac{\frac{y - z}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{1}}}{\frac{\sqrt[3]{a - z}}{t - x}}} + x\]
    13. Simplified8.5

      \[\leadsto \frac{\color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}}{\frac{\sqrt[3]{a - z}}{t - x}} + x\]

    if -2.0167221434791827e-79 < a < 1.082916304047229e-175

    1. Initial program 24.3

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right) + x}\]
    7. Simplified24.1

      \[\leadsto \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} + x\]
    8. Taylor expanded around inf 15.0

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

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

    if 1.082916304047229e-175 < a

    1. Initial program 12.1

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right) + x}\]
    7. Simplified12.1

      \[\leadsto \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} + x\]
    8. Using strategy rm
    9. Applied add-cube-cbrt12.6

      \[\leadsto \frac{y - z}{\frac{a - z}{\color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \sqrt[3]{t - x}}}} + x\]
    10. Applied add-cube-cbrt12.8

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

      \[\leadsto \frac{y - z}{\color{blue}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}} + x\]
    12. Applied *-un-lft-identity12.8

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}} \cdot \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}} + x\]
    14. Applied fma-def10.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}}, \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, x\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -2.0167221434791827 \cdot 10^{-79}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}{\frac{\sqrt[3]{a - z}}{t - x}}\\ \mathbf{elif}\;a \le 1.082916304047229 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}}, \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}, x\right)\\ \end{array}\]

Reproduce

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