Average Error: 14.2 → 7.2
Time: 23.5s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -5.175543709426314317899237427278029417013 \cdot 10^{-293}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)\right)\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 8.073274570222983893733737685727103294236 \cdot 10^{-256}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -5.175543709426314317899237427278029417013 \cdot 10^{-293}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r4190330 = x;
        double r4190331 = y;
        double r4190332 = z;
        double r4190333 = r4190331 - r4190332;
        double r4190334 = t;
        double r4190335 = r4190334 - r4190330;
        double r4190336 = a;
        double r4190337 = r4190336 - r4190332;
        double r4190338 = r4190335 / r4190337;
        double r4190339 = r4190333 * r4190338;
        double r4190340 = r4190330 + r4190339;
        return r4190340;
}

double f(double x, double y, double z, double t, double a) {
        double r4190341 = x;
        double r4190342 = t;
        double r4190343 = r4190342 - r4190341;
        double r4190344 = a;
        double r4190345 = z;
        double r4190346 = r4190344 - r4190345;
        double r4190347 = r4190343 / r4190346;
        double r4190348 = y;
        double r4190349 = r4190348 - r4190345;
        double r4190350 = r4190347 * r4190349;
        double r4190351 = r4190341 + r4190350;
        double r4190352 = -5.175543709426314e-293;
        bool r4190353 = r4190351 <= r4190352;
        double r4190354 = cbrt(r4190341);
        double r4190355 = r4190354 * r4190354;
        double r4190356 = cbrt(r4190343);
        double r4190357 = cbrt(r4190346);
        double r4190358 = r4190356 / r4190357;
        double r4190359 = r4190349 * r4190358;
        double r4190360 = r4190359 * r4190358;
        double r4190361 = r4190358 * r4190360;
        double r4190362 = fma(r4190355, r4190354, r4190361);
        double r4190363 = 8.073274570222984e-256;
        bool r4190364 = r4190351 <= r4190363;
        double r4190365 = r4190341 / r4190345;
        double r4190366 = fma(r4190365, r4190348, r4190342);
        double r4190367 = r4190342 / r4190345;
        double r4190368 = r4190367 * r4190348;
        double r4190369 = r4190366 - r4190368;
        double r4190370 = r4190364 ? r4190369 : r4190362;
        double r4190371 = r4190353 ? r4190362 : r4190370;
        return r4190371;
}

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)))) < -5.175543709426314e-293 or 8.073274570222984e-256 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 6.8

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt7.5

      \[\leadsto x + \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}}}\]
    4. Applied add-cube-cbrt7.7

      \[\leadsto x + \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}}\]
    5. Applied times-frac7.7

      \[\leadsto x + \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)}\]
    6. Applied associate-*r*4.5

      \[\leadsto x + \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}}}\]
    7. Simplified4.2

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} + \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(y - z\right)\right)\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    10. Applied fma-def4.6

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

    if -5.175543709426314e-293 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 8.073274570222984e-256

    1. Initial program 58.5

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Taylor expanded around inf 26.6

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

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

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

Reproduce

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