Average Error: 15.5 → 11.8
Time: 5.1s
Precision: binary64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -7.3811946255390914 \cdot 10^{145}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;z \le -2.17773616923341961 \cdot 10^{-82}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \mathbf{elif}\;z \le -7.5007130778928983 \cdot 10^{-263}:\\ \;\;\;\;x + \frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)\\ \mathbf{elif}\;z \le 6.866555469574397 \cdot 10^{171}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \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 -7.3811946255390914 \cdot 10^{145}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\

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

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

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

\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 <= -7.381194625539091e+145)) {
		VAR = ((double) (t + ((double) (y * ((double) (((double) (x / z)) - ((double) (t / z))))))));
	} else {
		double VAR_1;
		if ((z <= -2.1777361692334196e-82)) {
			VAR_1 = ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) * ((double) (1.0 / ((double) (a - z))))))))));
		} else {
			double VAR_2;
			if ((z <= -7.500713077892898e-263)) {
				VAR_2 = ((double) (x + ((double) (((double) (1.0 / ((double) (a - z)))) * ((double) (((double) (y - z)) * ((double) (t - x))))))));
			} else {
				double VAR_3;
				if ((z <= 6.866555469574397e+171)) {
					VAR_3 = ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) * ((double) (1.0 / ((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 < -7.3811946255390914e145 or 6.866555469574397e171 < z

    1. Initial program 29.7

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

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

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

    if -7.3811946255390914e145 < z < -2.17773616923341961e-82 or -7.5007130778928983e-263 < z < 6.866555469574397e171

    1. Initial program 10.7

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

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

    if -2.17773616923341961e-82 < z < -7.5007130778928983e-263

    1. Initial program 7.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -7.3811946255390914 \cdot 10^{145}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{elif}\;z \le -2.17773616923341961 \cdot 10^{-82}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \mathbf{elif}\;z \le -7.5007130778928983 \cdot 10^{-263}:\\ \;\;\;\;x + \frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)\\ \mathbf{elif}\;z \le 6.866555469574397 \cdot 10^{171}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \end{array}\]

Reproduce

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