Average Error: 15.3 → 10.6
Time: 6.3s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -1.21443315646892374 \cdot 10^{-273} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.4286800464491446 \cdot 10^{-253}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -1.21443315646892374 \cdot 10^{-273} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.4286800464491446 \cdot 10^{-253}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\

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

\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 VAR;
	if ((((x + ((y - z) * ((t - x) / (a - z)))) <= -1.2144331564689237e-273) || !((x + ((y - z) * ((t - x) / (a - z)))) <= 4.4286800464491446e-253))) {
		VAR = (x + ((y - z) * ((t - x) / (a - z))));
	} else {
		VAR = ((((x * y) / z) + t) - ((t * y) / z));
	}
	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 2 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -1.2144331564689237e-273 or 4.4286800464491446e-253 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.2

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

    if -1.2144331564689237e-273 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 4.4286800464491446e-253

    1. Initial program 58.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -1.21443315646892374 \cdot 10^{-273} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.4286800464491446 \cdot 10^{-253}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

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