Average Error: 14.8 → 10.1
Time: 9.4s
Precision: binary64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.1558964785433235 \cdot 10^{-200} \lor \neg \left(a \le 1.3539288939814582 \cdot 10^{-195}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\ \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}\;a \le -7.1558964785433235 \cdot 10^{-200} \lor \neg \left(a \le 1.3539288939814582 \cdot 10^{-195}\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\

\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 ((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 (((a <= -7.155896478543324e-200) || !(a <= 1.3539288939814582e-195))) {
		VAR = ((double) (x + ((double) (((double) (((double) (y - z)) / ((double) (a - z)))) * ((double) (t - x))))));
	} else {
		VAR = ((double) (((double) (((double) (((double) (x * y)) / z)) + t)) - ((double) (((double) (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 a < -7.1558964785433235e-200 or 1.3539288939814582e-195 < a

    1. Initial program 12.5

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \left(\color{blue}{t \cdot \frac{1}{a - z}} - x \cdot \frac{1}{a - z}\right)\]
    7. Applied distribute-rgt-out--12.5

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

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

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

    if -7.1558964785433235e-200 < a < 1.3539288939814582e-195

    1. Initial program 26.3

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

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

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

Reproduce

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