Average Error: 14.9 → 11.2
Time: 23.9s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -6.143232131925929682871142551410290774749 \cdot 10^{-28} \lor \neg \left(a \le 4.324311520218842582736217138705122405131 \cdot 10^{-174}\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(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -6.143232131925929682871142551410290774749 \cdot 10^{-28} \lor \neg \left(a \le 4.324311520218842582736217138705122405131 \cdot 10^{-174}\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(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r82238 = x;
        double r82239 = y;
        double r82240 = z;
        double r82241 = r82239 - r82240;
        double r82242 = t;
        double r82243 = r82242 - r82238;
        double r82244 = a;
        double r82245 = r82244 - r82240;
        double r82246 = r82243 / r82245;
        double r82247 = r82241 * r82246;
        double r82248 = r82238 + r82247;
        return r82248;
}

double f(double x, double y, double z, double t, double a) {
        double r82249 = a;
        double r82250 = -6.14323213192593e-28;
        bool r82251 = r82249 <= r82250;
        double r82252 = 4.324311520218843e-174;
        bool r82253 = r82249 <= r82252;
        double r82254 = !r82253;
        bool r82255 = r82251 || r82254;
        double r82256 = y;
        double r82257 = z;
        double r82258 = r82256 - r82257;
        double r82259 = t;
        double r82260 = x;
        double r82261 = r82259 - r82260;
        double r82262 = cbrt(r82261);
        double r82263 = r82262 * r82262;
        double r82264 = r82249 - r82257;
        double r82265 = cbrt(r82264);
        double r82266 = r82265 * r82265;
        double r82267 = r82263 / r82266;
        double r82268 = r82258 * r82267;
        double r82269 = r82262 / r82265;
        double r82270 = fma(r82268, r82269, r82260);
        double r82271 = r82260 / r82257;
        double r82272 = r82259 * r82256;
        double r82273 = r82272 / r82257;
        double r82274 = r82259 - r82273;
        double r82275 = fma(r82271, r82256, r82274);
        double r82276 = r82255 ? r82270 : r82275;
        return r82276;
}

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 < -6.14323213192593e-28 or 4.324311520218843e-174 < a

    1. Initial program 10.9

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

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

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

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

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

      \[\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\]
    10. Applied add-cube-cbrt11.6

      \[\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\]
    11. Applied times-frac11.6

      \[\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\]
    12. Applied associate-*r*9.1

      \[\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\]
    13. Using strategy rm
    14. Applied fma-def9.1

      \[\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 -6.14323213192593e-28 < a < 4.324311520218843e-174

    1. Initial program 24.3

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

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} + x\]
    8. Taylor expanded around inf 16.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -6.143232131925929682871142551410290774749 \cdot 10^{-28} \lor \neg \left(a \le 4.324311520218842582736217138705122405131 \cdot 10^{-174}\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(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \end{array}\]

Reproduce

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