Average Error: 14.9 → 11.1
Time: 5.0s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.08074360009009519 \cdot 10^{182}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{elif}\;z \le -1.924648186235541 \cdot 10^{118}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \mathbf{elif}\;z \le -1.02171718390721629 \cdot 10^{66}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{elif}\;z \le -1.67841403048886114 \cdot 10^{-95}:\\ \;\;\;\;\mathsf{fma}\left(\left(t - x\right) \cdot \frac{1}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}, \frac{y - z}{\sqrt[3]{a - z}}, x\right)\\ \mathbf{elif}\;z \le 2.6384696105968145 \cdot 10^{82}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \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}\;z \le -2.08074360009009519 \cdot 10^{182}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\

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

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

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

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

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z))))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((z <= -2.0807436000900952e+182)) {
		VAR = ((double) fma(y, ((double) (((double) (x / z)) - ((double) (t / z)))), t));
	} else {
		double VAR_1;
		if ((z <= -1.924648186235541e+118)) {
			VAR_1 = ((double) (((double) (((double) (t - x)) / ((double) (((double) (a - z)) / ((double) (y - z)))))) + x));
		} else {
			double VAR_2;
			if ((z <= -1.0217171839072163e+66)) {
				VAR_2 = ((double) fma(y, ((double) (((double) (x / z)) - ((double) (t / z)))), t));
			} else {
				double VAR_3;
				if ((z <= -1.678414030488861e-95)) {
					VAR_3 = ((double) fma(((double) (((double) (t - x)) * ((double) (1.0 / ((double) (((double) cbrt(((double) (a - z)))) * ((double) cbrt(((double) (a - z)))))))))), ((double) (((double) (y - z)) / ((double) cbrt(((double) (a - z)))))), x));
				} else {
					double VAR_4;
					if ((z <= 2.6384696105968145e+82)) {
						VAR_4 = ((double) (((double) (((double) (t - x)) / ((double) (((double) (a - z)) / ((double) (y - z)))))) + x));
					} else {
						VAR_4 = ((double) fma(y, ((double) (((double) (x / z)) - ((double) (t / z)))), t));
					}
					VAR_3 = VAR_4;
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.0807436000900952e+182 or -1.924648186235541e+118 < z < -1.0217171839072163e+66 or 2.6384696105968145e+82 < z

    1. Initial program 24.8

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

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

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

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

    if -2.0807436000900952e+182 < z < -1.924648186235541e+118 or -1.678414030488861e-95 < z < 2.6384696105968145e+82

    1. Initial program 9.4

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

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

      \[\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-udef9.4

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

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

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

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

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{y - z}{a - z}} + x\]
    12. Using strategy rm
    13. Applied clear-num6.6

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

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

    if -1.0217171839072163e+66 < z < -1.678414030488861e-95

    1. Initial program 8.8

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

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

      \[\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-udef8.8

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

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

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

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

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{y - z}{a - z}} + x\]
    12. Using strategy rm
    13. Applied add-cube-cbrt8.1

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.08074360009009519 \cdot 10^{182}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{elif}\;z \le -1.924648186235541 \cdot 10^{118}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \mathbf{elif}\;z \le -1.02171718390721629 \cdot 10^{66}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{elif}\;z \le -1.67841403048886114 \cdot 10^{-95}:\\ \;\;\;\;\mathsf{fma}\left(\left(t - x\right) \cdot \frac{1}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}, \frac{y - z}{\sqrt[3]{a - z}}, x\right)\\ \mathbf{elif}\;z \le 2.6384696105968145 \cdot 10^{82}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]

Reproduce

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