Average Error: 14.9 → 10.9
Time: 18.5s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.7916675455541999 \cdot 10^{190}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;z \le -7.29199372430577621 \cdot 10^{117}:\\ \;\;\;\;x + \frac{y - z}{-\left(a - z\right)} \cdot \left(-\left(t - x\right)\right)\\ \mathbf{elif}\;z \le -7.9425005692074541 \cdot 10^{65}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;z \le 2.50608572105253218 \cdot 10^{82}:\\ \;\;\;\;x + \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}}\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -2.7916675455541999 \cdot 10^{190}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\

\mathbf{elif}\;z \le -7.29199372430577621 \cdot 10^{117}:\\
\;\;\;\;x + \frac{y - z}{-\left(a - z\right)} \cdot \left(-\left(t - x\right)\right)\\

\mathbf{elif}\;z \le -7.9425005692074541 \cdot 10^{65}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\

\mathbf{elif}\;z \le 2.50608572105253218 \cdot 10^{82}:\\
\;\;\;\;x + \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}}\\

\mathbf{else}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\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.7916675455542e+190)) {
		VAR = ((double) (t + ((double) (y * ((double) (((double) (x / z)) - ((double) (t / z))))))));
	} else {
		double VAR_1;
		if ((z <= -7.291993724305776e+117)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - z)) / ((double) -(((double) (a - z)))))) * ((double) -(((double) (t - x))))))));
		} else {
			double VAR_2;
			if ((z <= -7.942500569207454e+65)) {
				VAR_2 = ((double) (t + ((double) (y * ((double) (((double) (x / z)) - ((double) (t / z))))))));
			} else {
				double VAR_3;
				if ((z <= 2.5060857210525322e+82)) {
					VAR_3 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (((double) (((double) cbrt(((double) (t - x)))) * ((double) cbrt(((double) (t - x)))))) / ((double) (((double) cbrt(((double) (a - z)))) * ((double) cbrt(((double) (a - z)))))))))) * ((double) (((double) cbrt(((double) (t - x)))) / ((double) cbrt(((double) (a - z))))))))));
				} else {
					VAR_3 = ((double) (t + ((double) (y * ((double) (((double) (x / z)) - ((double) (t / z))))))));
				}
				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.7916675455542e+190 or -7.291993724305776e+117 < z < -7.942500569207454e+65 or 2.5060857210525322e+82 < z

    1. Initial program 24.7

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

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

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

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

      \[\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. Taylor expanded around inf 26.6

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

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

    if -2.7916675455542e+190 < z < -7.291993724305776e+117

    1. Initial program 21.3

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}}\]
    5. Using strategy rm
    6. Applied frac-2neg21.6

      \[\leadsto x + \frac{y - z}{\color{blue}{\frac{-\left(a - z\right)}{-\left(t - x\right)}}}\]
    7. Applied associate-/r/18.6

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

    if -7.942500569207454e+65 < z < 2.5060857210525322e+82

    1. Initial program 8.2

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

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

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

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

      \[\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}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.7916675455541999 \cdot 10^{190}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;z \le -7.29199372430577621 \cdot 10^{117}:\\ \;\;\;\;x + \frac{y - z}{-\left(a - z\right)} \cdot \left(-\left(t - x\right)\right)\\ \mathbf{elif}\;z \le -7.9425005692074541 \cdot 10^{65}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;z \le 2.50608572105253218 \cdot 10^{82}:\\ \;\;\;\;x + \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}}\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \end{array}\]

Reproduce

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