Average Error: 14.9 → 12.3
Time: 4.0m
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.6105916431147138 \cdot 10^{171}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{elif}\;z \le -1.061022533733094 \cdot 10^{-165}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;z \le 9.7047982793877566 \cdot 10^{127}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \left(\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \left(\sqrt[3]{\sqrt[3]{t - x}} \cdot \sqrt[3]{\sqrt[3]{t - x}}\right)}{\sqrt[3]{a - z} \cdot \sqrt[3]{1}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{t - x}}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\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}\;z \le -2.6105916431147138 \cdot 10^{171}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\

\mathbf{elif}\;z \le -1.061022533733094 \cdot 10^{-165}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\

\mathbf{elif}\;z \le 9.7047982793877566 \cdot 10^{127}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \left(\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \left(\sqrt[3]{\sqrt[3]{t - x}} \cdot \sqrt[3]{\sqrt[3]{t - x}}\right)}{\sqrt[3]{a - z} \cdot \sqrt[3]{1}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{t - x}}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return (x + ((y - z) * ((t - x) / (a - z))));
}
double code(double x, double y, double z, double t, double a) {
	double temp;
	if ((z <= -2.610591643114714e+171)) {
		temp = fma((x / z), y, (t - ((t * y) / z)));
	} else {
		double temp_1;
		if ((z <= -1.061022533733094e-165)) {
			temp_1 = (x + ((y - z) / ((a - z) / (t - x))));
		} else {
			double temp_2;
			if ((z <= 9.704798279387757e+127)) {
				temp_2 = fma((cbrt(x) * cbrt(x)), cbrt(x), ((((y - z) * ((cbrt((t - x)) * (cbrt(cbrt((t - x))) * cbrt(cbrt((t - x))))) / (cbrt((a - z)) * cbrt(1.0)))) * (cbrt(cbrt((t - x))) / cbrt((a - z)))) * (cbrt((t - x)) / cbrt((a - z)))));
			} else {
				temp_2 = fma((x / z), y, (t - ((t * y) / z)));
			}
			temp_1 = temp_2;
		}
		temp = temp_1;
	}
	return temp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if z < -2.610591643114714e+171 or 9.704798279387757e+127 < z

    1. Initial program 27.8

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

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

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

    if -2.610591643114714e+171 < z < -1.061022533733094e-165

    1. Initial program 11.0

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}}\]
    4. Applied un-div-inv11.0

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

    if -1.061022533733094e-165 < z < 9.704798279387757e+127

    1. Initial program 8.9

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

      \[\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-cbrt9.5

      \[\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-frac9.5

      \[\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*5.7

      \[\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. Using strategy rm
    8. Applied *-un-lft-identity5.7

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

      \[\leadsto x + \left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{a - z}\right)}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    10. Applied associate-*r*5.7

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

      \[\leadsto x + \left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{t - x}} \cdot \sqrt[3]{\sqrt[3]{t - x}}\right) \cdot \sqrt[3]{\sqrt[3]{t - x}}\right)}}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    12. Applied associate-*r*5.8

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

      \[\leadsto x + \left(\left(y - z\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{t - x} \cdot \left(\sqrt[3]{\sqrt[3]{t - x}} \cdot \sqrt[3]{\sqrt[3]{t - x}}\right)}{\sqrt[3]{a - z} \cdot \sqrt[3]{1}} \cdot \frac{\sqrt[3]{\sqrt[3]{t - x}}}{\sqrt[3]{a - z}}\right)}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    14. Applied associate-*r*6.0

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} + \left(\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \left(\sqrt[3]{\sqrt[3]{t - x}} \cdot \sqrt[3]{\sqrt[3]{t - x}}\right)}{\sqrt[3]{a - z} \cdot \sqrt[3]{1}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{t - x}}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    17. Applied fma-def6.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.6105916431147138 \cdot 10^{171}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{elif}\;z \le -1.061022533733094 \cdot 10^{-165}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;z \le 9.7047982793877566 \cdot 10^{127}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \left(\left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \left(\sqrt[3]{\sqrt[3]{t - x}} \cdot \sqrt[3]{\sqrt[3]{t - x}}\right)}{\sqrt[3]{a - z} \cdot \sqrt[3]{1}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{t - x}}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \end{array}\]

Reproduce

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