Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.9% → 95.3%
Time: 9.3s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot z}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
	return x + (((y - x) * z) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + (((y - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + (((y - x) * z) / t);
}
def code(x, y, z, t):
	return x + (((y - x) * z) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(Float64(y - x) * z) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + (((y - x) * z) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 92.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot z}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
	return x + (((y - x) * z) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + (((y - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + (((y - x) * z) / t);
}
def code(x, y, z, t):
	return x + (((y - x) * z) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(Float64(y - x) * z) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + (((y - x) * z) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}

Alternative 1: 95.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 4.2 \cdot 10^{-95}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y - x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z 4.2e-95) (+ x (/ (* (- y x) z) t)) (+ x (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 4.2e-95) {
		tmp = x + (((y - x) * z) / t);
	} else {
		tmp = x + (z * ((y - x) / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= 4.2d-95) then
        tmp = x + (((y - x) * z) / t)
    else
        tmp = x + (z * ((y - x) / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 4.2e-95) {
		tmp = x + (((y - x) * z) / t);
	} else {
		tmp = x + (z * ((y - x) / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= 4.2e-95:
		tmp = x + (((y - x) * z) / t)
	else:
		tmp = x + (z * ((y - x) / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= 4.2e-95)
		tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / t));
	else
		tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= 4.2e-95)
		tmp = x + (((y - x) * z) / t);
	else
		tmp = x + (z * ((y - x) / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, 4.2e-95], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.2 \cdot 10^{-95}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.2e-95

    1. Initial program 96.7%

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

    if 4.2e-95 < z

    1. Initial program 88.2%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. associate-*l/99.0%

        \[\leadsto x + \color{blue}{\frac{y - x}{t} \cdot z} \]
    3. Applied egg-rr99.0%

      \[\leadsto x + \color{blue}{\frac{y - x}{t} \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 4.2 \cdot 10^{-95}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y - x}{t}\\ \end{array} \]

Alternative 2: 97.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y - x, \frac{z}{t}, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (- y x) (/ z t) x))
double code(double x, double y, double z, double t) {
	return fma((y - x), (z / t), x);
}
function code(x, y, z, t)
	return fma(Float64(y - x), Float64(z / t), x)
end
code[x_, y_, z_, t_] := N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)
\end{array}
Derivation
  1. Initial program 94.0%

    \[x + \frac{\left(y - x\right) \cdot z}{t} \]
  2. Step-by-step derivation
    1. +-commutative94.0%

      \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
    2. remove-double-neg94.0%

      \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
    3. unsub-neg94.0%

      \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
    4. associate-*r/97.2%

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
    5. fma-neg97.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
    6. remove-double-neg97.2%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
  4. Final simplification97.2%

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

Alternative 3: 70.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+193}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{+137}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;t \leq -2.95 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+101}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -1.2e+193)
   x
   (if (<= t -8.5e+137)
     (* z (/ (- y x) t))
     (if (<= t -2.95e+16) x (if (<= t 2e+101) (* (- y x) (/ z t)) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.2e+193) {
		tmp = x;
	} else if (t <= -8.5e+137) {
		tmp = z * ((y - x) / t);
	} else if (t <= -2.95e+16) {
		tmp = x;
	} else if (t <= 2e+101) {
		tmp = (y - x) * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1.2d+193)) then
        tmp = x
    else if (t <= (-8.5d+137)) then
        tmp = z * ((y - x) / t)
    else if (t <= (-2.95d+16)) then
        tmp = x
    else if (t <= 2d+101) then
        tmp = (y - x) * (z / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.2e+193) {
		tmp = x;
	} else if (t <= -8.5e+137) {
		tmp = z * ((y - x) / t);
	} else if (t <= -2.95e+16) {
		tmp = x;
	} else if (t <= 2e+101) {
		tmp = (y - x) * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -1.2e+193:
		tmp = x
	elif t <= -8.5e+137:
		tmp = z * ((y - x) / t)
	elif t <= -2.95e+16:
		tmp = x
	elif t <= 2e+101:
		tmp = (y - x) * (z / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1.2e+193)
		tmp = x;
	elseif (t <= -8.5e+137)
		tmp = Float64(z * Float64(Float64(y - x) / t));
	elseif (t <= -2.95e+16)
		tmp = x;
	elseif (t <= 2e+101)
		tmp = Float64(Float64(y - x) * Float64(z / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -1.2e+193)
		tmp = x;
	elseif (t <= -8.5e+137)
		tmp = z * ((y - x) / t);
	elseif (t <= -2.95e+16)
		tmp = x;
	elseif (t <= 2e+101)
		tmp = (y - x) * (z / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.2e+193], x, If[LessEqual[t, -8.5e+137], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.95e+16], x, If[LessEqual[t, 2e+101], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+193}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -8.5 \cdot 10^{+137}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\

\mathbf{elif}\;t \leq -2.95 \cdot 10^{+16}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 2 \cdot 10^{+101}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.2e193 or -8.50000000000000028e137 < t < -2.95e16 or 2e101 < t

    1. Initial program 89.4%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative89.4%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg89.4%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/98.4%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg98.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg98.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around 0 77.1%

      \[\leadsto \color{blue}{x} \]

    if -1.2e193 < t < -8.50000000000000028e137

    1. Initial program 74.1%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative74.1%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg74.1%

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
      3. unsub-neg74.1%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg99.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 70.3%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 70.3%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative70.3%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg70.3%

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub70.3%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified70.3%

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

    if -2.95e16 < t < 2e101

    1. Initial program 98.1%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative98.1%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg98.1%

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
      3. unsub-neg98.1%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/96.3%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg96.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg96.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 69.0%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 69.0%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative69.0%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg69.0%

        \[\leadsto z \cdot \left(\frac{y}{t} + \color{blue}{\left(-\frac{x}{t}\right)}\right) \]
      3. sub-neg69.0%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub71.7%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified71.7%

      \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    8. Step-by-step derivation
      1. clear-num71.5%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{y - x}}} \]
      2. un-div-inv72.1%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y - x}}} \]
    9. Applied egg-rr72.1%

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y - x}}} \]
    10. Step-by-step derivation
      1. associate-/r/78.4%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \left(y - x\right)} \]
    11. Applied egg-rr78.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+193}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{+137}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;t \leq -2.95 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+101}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 55.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot z}{t}\\ \mathbf{if}\;t \leq -1200000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -1.8 \cdot 10^{-249}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.8 \cdot 10^{-264}:\\ \;\;\;\;\frac{x}{t} \cdot \left(-z\right)\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* y z) t)))
   (if (<= t -1200000000000.0)
     x
     (if (<= t -1.8e-249)
       t_1
       (if (<= t -2.8e-264) (* (/ x t) (- z)) (if (<= t 2.3e-33) t_1 x))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * z) / t;
	double tmp;
	if (t <= -1200000000000.0) {
		tmp = x;
	} else if (t <= -1.8e-249) {
		tmp = t_1;
	} else if (t <= -2.8e-264) {
		tmp = (x / t) * -z;
	} else if (t <= 2.3e-33) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y * z) / t
    if (t <= (-1200000000000.0d0)) then
        tmp = x
    else if (t <= (-1.8d-249)) then
        tmp = t_1
    else if (t <= (-2.8d-264)) then
        tmp = (x / t) * -z
    else if (t <= 2.3d-33) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y * z) / t;
	double tmp;
	if (t <= -1200000000000.0) {
		tmp = x;
	} else if (t <= -1.8e-249) {
		tmp = t_1;
	} else if (t <= -2.8e-264) {
		tmp = (x / t) * -z;
	} else if (t <= 2.3e-33) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * z) / t
	tmp = 0
	if t <= -1200000000000.0:
		tmp = x
	elif t <= -1.8e-249:
		tmp = t_1
	elif t <= -2.8e-264:
		tmp = (x / t) * -z
	elif t <= 2.3e-33:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y * z) / t)
	tmp = 0.0
	if (t <= -1200000000000.0)
		tmp = x;
	elseif (t <= -1.8e-249)
		tmp = t_1;
	elseif (t <= -2.8e-264)
		tmp = Float64(Float64(x / t) * Float64(-z));
	elseif (t <= 2.3e-33)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y * z) / t;
	tmp = 0.0;
	if (t <= -1200000000000.0)
		tmp = x;
	elseif (t <= -1.8e-249)
		tmp = t_1;
	elseif (t <= -2.8e-264)
		tmp = (x / t) * -z;
	elseif (t <= 2.3e-33)
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -1200000000000.0], x, If[LessEqual[t, -1.8e-249], t$95$1, If[LessEqual[t, -2.8e-264], N[(N[(x / t), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[t, 2.3e-33], t$95$1, x]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot z}{t}\\
\mathbf{if}\;t \leq -1200000000000:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -1.8 \cdot 10^{-249}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -2.8 \cdot 10^{-264}:\\
\;\;\;\;\frac{x}{t} \cdot \left(-z\right)\\

\mathbf{elif}\;t \leq 2.3 \cdot 10^{-33}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.2e12 or 2.29999999999999986e-33 < t

    1. Initial program 90.0%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative90.0%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg90.0%

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
      3. unsub-neg90.0%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/98.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg98.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg98.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around 0 65.8%

      \[\leadsto \color{blue}{x} \]

    if -1.2e12 < t < -1.79999999999999997e-249 or -2.80000000000000012e-264 < t < 2.29999999999999986e-33

    1. Initial program 97.7%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative97.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg97.7%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/96.2%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg96.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg96.2%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 69.4%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 69.4%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative69.4%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg69.4%

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub72.7%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified72.7%

      \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    8. Taylor expanded in z around 0 83.1%

      \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
    9. Taylor expanded in y around inf 61.6%

      \[\leadsto \frac{\color{blue}{y \cdot z}}{t} \]

    if -1.79999999999999997e-249 < t < -2.80000000000000012e-264

    1. Initial program 99.7%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative99.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg99.7%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/84.6%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg84.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg84.6%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 100.0%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 100.0%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto z \cdot \color{blue}{\left(-\frac{x}{t}\right)} \]
      2. distribute-frac-neg100.0%

        \[\leadsto z \cdot \color{blue}{\frac{-x}{t}} \]
    7. Simplified100.0%

      \[\leadsto z \cdot \color{blue}{\frac{-x}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1200000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -1.8 \cdot 10^{-249}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;t \leq -2.8 \cdot 10^{-264}:\\ \;\;\;\;\frac{x}{t} \cdot \left(-z\right)\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 94.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-131} \lor \neg \left(z \leq 5.5 \cdot 10^{-97}\right):\\ \;\;\;\;x + z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.75e-131) (not (<= z 5.5e-97)))
   (+ x (* z (/ (- y x) t)))
   (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.75e-131) || !(z <= 5.5e-97)) {
		tmp = x + (z * ((y - x) / t));
	} else {
		tmp = x + ((y * z) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.75d-131)) .or. (.not. (z <= 5.5d-97))) then
        tmp = x + (z * ((y - x) / t))
    else
        tmp = x + ((y * z) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.75e-131) || !(z <= 5.5e-97)) {
		tmp = x + (z * ((y - x) / t));
	} else {
		tmp = x + ((y * z) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.75e-131) or not (z <= 5.5e-97):
		tmp = x + (z * ((y - x) / t))
	else:
		tmp = x + ((y * z) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.75e-131) || !(z <= 5.5e-97))
		tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t)));
	else
		tmp = Float64(x + Float64(Float64(y * z) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.75e-131) || ~((z <= 5.5e-97)))
		tmp = x + (z * ((y - x) / t));
	else
		tmp = x + ((y * z) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.75e-131], N[Not[LessEqual[z, 5.5e-97]], $MachinePrecision]], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-131} \lor \neg \left(z \leq 5.5 \cdot 10^{-97}\right):\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7500000000000001e-131 or 5.49999999999999948e-97 < z

    1. Initial program 91.8%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. associate-*l/98.9%

        \[\leadsto x + \color{blue}{\frac{y - x}{t} \cdot z} \]
    3. Applied egg-rr98.9%

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

    if -1.7500000000000001e-131 < z < 5.49999999999999948e-97

    1. Initial program 97.9%

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

      \[\leadsto x + \frac{\color{blue}{y \cdot z}}{t} \]
    3. Step-by-step derivation
      1. *-commutative91.5%

        \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
    4. Simplified91.5%

      \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-131} \lor \neg \left(z \leq 5.5 \cdot 10^{-97}\right):\\ \;\;\;\;x + z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \end{array} \]

Alternative 6: 85.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.42 \cdot 10^{+118} \lor \neg \left(x \leq 5.2 \cdot 10^{+42}\right):\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -1.42e+118) (not (<= x 5.2e+42)))
   (* x (- (- -1.0) (/ z t)))
   (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.42e+118) || !(x <= 5.2e+42)) {
		tmp = x * (-(-1.0) - (z / t));
	} else {
		tmp = x + (y / (t / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x <= (-1.42d+118)) .or. (.not. (x <= 5.2d+42))) then
        tmp = x * (-(-1.0d0) - (z / t))
    else
        tmp = x + (y / (t / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.42e+118) || !(x <= 5.2e+42)) {
		tmp = x * (-(-1.0) - (z / t));
	} else {
		tmp = x + (y / (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -1.42e+118) or not (x <= 5.2e+42):
		tmp = x * (-(-1.0) - (z / t))
	else:
		tmp = x + (y / (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -1.42e+118) || !(x <= 5.2e+42))
		tmp = Float64(x * Float64(Float64(-(-1.0)) - Float64(z / t)));
	else
		tmp = Float64(x + Float64(y / Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -1.42e+118) || ~((x <= 5.2e+42)))
		tmp = x * (-(-1.0) - (z / t));
	else
		tmp = x + (y / (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.42e+118], N[Not[LessEqual[x, 5.2e+42]], $MachinePrecision]], N[(x * N[((--1.0) - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42 \cdot 10^{+118} \lor \neg \left(x \leq 5.2 \cdot 10^{+42}\right):\\
\;\;\;\;x \cdot \left(\left(--1\right) - \frac{z}{t}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.41999999999999999e118 or 5.1999999999999998e42 < x

    1. Initial program 92.5%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative92.5%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg92.5%

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
      3. unsub-neg92.5%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/100.0%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in x around -inf 91.5%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(\frac{z}{t} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*91.5%

        \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot \left(\frac{z}{t} - 1\right)} \]
      2. neg-mul-191.5%

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{z}{t} - 1\right) \]
      3. *-commutative91.5%

        \[\leadsto \color{blue}{\left(\frac{z}{t} - 1\right) \cdot \left(-x\right)} \]
      4. sub-neg91.5%

        \[\leadsto \color{blue}{\left(\frac{z}{t} + \left(-1\right)\right)} \cdot \left(-x\right) \]
      5. metadata-eval91.5%

        \[\leadsto \left(\frac{z}{t} + \color{blue}{-1}\right) \cdot \left(-x\right) \]
      6. +-commutative91.5%

        \[\leadsto \color{blue}{\left(-1 + \frac{z}{t}\right)} \cdot \left(-x\right) \]
    6. Simplified91.5%

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

    if -1.41999999999999999e118 < x < 5.1999999999999998e42

    1. Initial program 95.0%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-/l*88.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    4. Simplified88.3%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.42 \cdot 10^{+118} \lor \neg \left(x \leq 5.2 \cdot 10^{+42}\right):\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 7: 71.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-85} \lor \neg \left(z \leq 3.8 \cdot 10^{-77}\right):\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -7.2e-85) (not (<= z 3.8e-77))) (* z (/ (- y x) t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.2e-85) || !(z <= 3.8e-77)) {
		tmp = z * ((y - x) / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-7.2d-85)) .or. (.not. (z <= 3.8d-77))) then
        tmp = z * ((y - x) / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.2e-85) || !(z <= 3.8e-77)) {
		tmp = z * ((y - x) / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -7.2e-85) or not (z <= 3.8e-77):
		tmp = z * ((y - x) / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -7.2e-85) || !(z <= 3.8e-77))
		tmp = Float64(z * Float64(Float64(y - x) / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -7.2e-85) || ~((z <= 3.8e-77)))
		tmp = z * ((y - x) / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.2e-85], N[Not[LessEqual[z, 3.8e-77]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-85} \lor \neg \left(z \leq 3.8 \cdot 10^{-77}\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.1999999999999996e-85 or 3.7999999999999999e-77 < z

    1. Initial program 91.7%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative91.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg91.7%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/96.2%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg96.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg96.2%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 76.2%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 76.2%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative76.2%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg76.2%

        \[\leadsto z \cdot \left(\frac{y}{t} + \color{blue}{\left(-\frac{x}{t}\right)}\right) \]
      3. sub-neg76.2%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub77.5%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified77.5%

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

    if -7.1999999999999996e-85 < z < 3.7999999999999999e-77

    1. Initial program 97.3%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative97.3%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg97.3%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/98.6%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg98.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg98.6%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around 0 64.1%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-85} \lor \neg \left(z \leq 3.8 \cdot 10^{-77}\right):\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 84.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+145} \lor \neg \left(z \leq 6.4 \cdot 10^{+68}\right):\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.25e+145) (not (<= z 6.4e+68)))
   (* z (/ (- y x) t))
   (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.25e+145) || !(z <= 6.4e+68)) {
		tmp = z * ((y - x) / t);
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.25d+145)) .or. (.not. (z <= 6.4d+68))) then
        tmp = z * ((y - x) / t)
    else
        tmp = x + (y * (z / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.25e+145) || !(z <= 6.4e+68)) {
		tmp = z * ((y - x) / t);
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.25e+145) or not (z <= 6.4e+68):
		tmp = z * ((y - x) / t)
	else:
		tmp = x + (y * (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.25e+145) || !(z <= 6.4e+68))
		tmp = Float64(z * Float64(Float64(y - x) / t));
	else
		tmp = Float64(x + Float64(y * Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.25e+145) || ~((z <= 6.4e+68)))
		tmp = z * ((y - x) / t);
	else
		tmp = x + (y * (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e+145], N[Not[LessEqual[z, 6.4e+68]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+145} \lor \neg \left(z \leq 6.4 \cdot 10^{+68}\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.24999999999999992e145 or 6.39999999999999989e68 < z

    1. Initial program 90.3%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative90.3%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg90.3%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/92.9%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg92.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg92.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 85.9%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 85.9%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative85.9%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg85.9%

        \[\leadsto z \cdot \left(\frac{y}{t} + \color{blue}{\left(-\frac{x}{t}\right)}\right) \]
      3. sub-neg85.9%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub88.3%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified88.3%

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

    if -1.24999999999999992e145 < z < 6.39999999999999989e68

    1. Initial program 95.7%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-/l*88.8%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    4. Simplified88.8%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Step-by-step derivation
      1. div-inv88.7%

        \[\leadsto x + \color{blue}{y \cdot \frac{1}{\frac{t}{z}}} \]
      2. clear-num88.8%

        \[\leadsto x + y \cdot \color{blue}{\frac{z}{t}} \]
      3. *-commutative88.8%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
    6. Applied egg-rr88.8%

      \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+145} \lor \neg \left(z \leq 6.4 \cdot 10^{+68}\right):\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 9: 83.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+144}:\\ \;\;\;\;\frac{z}{\frac{t}{y - x}}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+65}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.9e+144)
   (/ z (/ t (- y x)))
   (if (<= z 1.3e+65) (+ x (* y (/ z t))) (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.9e+144) {
		tmp = z / (t / (y - x));
	} else if (z <= 1.3e+65) {
		tmp = x + (y * (z / t));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-1.9d+144)) then
        tmp = z / (t / (y - x))
    else if (z <= 1.3d+65) then
        tmp = x + (y * (z / t))
    else
        tmp = z * ((y - x) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.9e+144) {
		tmp = z / (t / (y - x));
	} else if (z <= 1.3e+65) {
		tmp = x + (y * (z / t));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.9e+144:
		tmp = z / (t / (y - x))
	elif z <= 1.3e+65:
		tmp = x + (y * (z / t))
	else:
		tmp = z * ((y - x) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.9e+144)
		tmp = Float64(z / Float64(t / Float64(y - x)));
	elseif (z <= 1.3e+65)
		tmp = Float64(x + Float64(y * Float64(z / t)));
	else
		tmp = Float64(z * Float64(Float64(y - x) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.9e+144)
		tmp = z / (t / (y - x));
	elseif (z <= 1.3e+65)
		tmp = x + (y * (z / t));
	else
		tmp = z * ((y - x) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.9e+144], N[(z / N[(t / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+65], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+144}:\\
\;\;\;\;\frac{z}{\frac{t}{y - x}}\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+65}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.90000000000000013e144

    1. Initial program 93.3%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative93.3%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg93.3%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/90.3%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg90.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg90.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 96.3%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 96.3%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative96.3%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg96.3%

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub99.8%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified99.8%

      \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    8. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{y - x}}} \]
      2. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y - x}}} \]
    9. Applied egg-rr99.9%

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

    if -1.90000000000000013e144 < z < 1.30000000000000001e65

    1. Initial program 95.7%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-/l*88.8%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    4. Simplified88.8%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    5. Step-by-step derivation
      1. div-inv88.7%

        \[\leadsto x + \color{blue}{y \cdot \frac{1}{\frac{t}{z}}} \]
      2. clear-num88.8%

        \[\leadsto x + y \cdot \color{blue}{\frac{z}{t}} \]
      3. *-commutative88.8%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
    6. Applied egg-rr88.8%

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

    if 1.30000000000000001e65 < z

    1. Initial program 88.6%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative88.6%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg88.6%

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
      3. unsub-neg88.6%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/94.4%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg94.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg94.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 79.9%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 79.9%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative79.9%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg79.9%

        \[\leadsto z \cdot \left(\frac{y}{t} + \color{blue}{\left(-\frac{x}{t}\right)}\right) \]
      3. sub-neg79.9%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub81.8%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified81.8%

      \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+144}:\\ \;\;\;\;\frac{z}{\frac{t}{y - x}}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+65}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \]

Alternative 10: 52.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -650000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-34}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -650000000000.0) x (if (<= t 1.65e-34) (* z (/ y t)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -650000000000.0) {
		tmp = x;
	} else if (t <= 1.65e-34) {
		tmp = z * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-650000000000.0d0)) then
        tmp = x
    else if (t <= 1.65d-34) then
        tmp = z * (y / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -650000000000.0) {
		tmp = x;
	} else if (t <= 1.65e-34) {
		tmp = z * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -650000000000.0:
		tmp = x
	elif t <= 1.65e-34:
		tmp = z * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -650000000000.0)
		tmp = x;
	elseif (t <= 1.65e-34)
		tmp = Float64(z * Float64(y / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -650000000000.0)
		tmp = x;
	elseif (t <= 1.65e-34)
		tmp = z * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -650000000000.0], x, If[LessEqual[t, 1.65e-34], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -650000000000:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{-34}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.5e11 or 1.64999999999999991e-34 < t

    1. Initial program 90.0%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative90.0%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg90.0%

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
      3. unsub-neg90.0%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/98.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg98.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg98.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around 0 65.8%

      \[\leadsto \color{blue}{x} \]

    if -6.5e11 < t < 1.64999999999999991e-34

    1. Initial program 97.7%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative97.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg97.7%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/95.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg95.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg95.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 70.8%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around inf 53.7%

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -650000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-34}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 55.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4400000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{-35}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -4400000000000.0) x (if (<= t 1.02e-35) (/ (* y z) t) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4400000000000.0) {
		tmp = x;
	} else if (t <= 1.02e-35) {
		tmp = (y * z) / t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4400000000000.0d0)) then
        tmp = x
    else if (t <= 1.02d-35) then
        tmp = (y * z) / t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4400000000000.0) {
		tmp = x;
	} else if (t <= 1.02e-35) {
		tmp = (y * z) / t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -4400000000000.0:
		tmp = x
	elif t <= 1.02e-35:
		tmp = (y * z) / t
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -4400000000000.0)
		tmp = x;
	elseif (t <= 1.02e-35)
		tmp = Float64(Float64(y * z) / t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -4400000000000.0)
		tmp = x;
	elseif (t <= 1.02e-35)
		tmp = (y * z) / t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -4400000000000.0], x, If[LessEqual[t, 1.02e-35], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4400000000000:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.02 \cdot 10^{-35}:\\
\;\;\;\;\frac{y \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.4e12 or 1.01999999999999995e-35 < t

    1. Initial program 90.0%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative90.0%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg90.0%

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
      3. unsub-neg90.0%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/98.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg98.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg98.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around 0 65.8%

      \[\leadsto \color{blue}{x} \]

    if -4.4e12 < t < 1.01999999999999995e-35

    1. Initial program 97.7%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Step-by-step derivation
      1. +-commutative97.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      2. remove-double-neg97.7%

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
      4. associate-*r/95.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
      5. fma-neg95.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
      6. remove-double-neg95.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
    4. Taylor expanded in z around inf 70.8%

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    5. Taylor expanded in y around 0 70.8%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{t} + \frac{y}{t}\right)} \]
    6. Step-by-step derivation
      1. +-commutative70.8%

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} + -1 \cdot \frac{x}{t}\right)} \]
      2. mul-1-neg70.8%

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub74.0%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified74.0%

      \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    8. Taylor expanded in z around 0 83.9%

      \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
    9. Taylor expanded in y around inf 59.7%

      \[\leadsto \frac{\color{blue}{y \cdot z}}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4400000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{-35}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y - x\right) \cdot \frac{z}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - x) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - x) * (z / t));
}
def code(x, y, z, t):
	return x + ((y - x) * (z / t))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - x) * Float64(z / t)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - x) * (z / t));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
Derivation
  1. Initial program 94.0%

    \[x + \frac{\left(y - x\right) \cdot z}{t} \]
  2. Step-by-step derivation
    1. +-commutative94.0%

      \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
    2. remove-double-neg94.0%

      \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
    3. unsub-neg94.0%

      \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
    4. associate-*r/97.2%

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
    5. fma-neg97.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
    6. remove-double-neg97.2%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
  4. Step-by-step derivation
    1. fma-udef97.2%

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t} + x} \]
  5. Applied egg-rr97.2%

    \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t} + x} \]
  6. Final simplification97.2%

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

Alternative 13: 38.3% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 94.0%

    \[x + \frac{\left(y - x\right) \cdot z}{t} \]
  2. Step-by-step derivation
    1. +-commutative94.0%

      \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
    2. remove-double-neg94.0%

      \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{\left(-\left(-x\right)\right)} \]
    3. unsub-neg94.0%

      \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} - \left(-x\right)} \]
    4. associate-*r/97.2%

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} - \left(-x\right) \]
    5. fma-neg97.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, -\left(-x\right)\right)} \]
    6. remove-double-neg97.2%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
  4. Taylor expanded in z around 0 39.8%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification39.8%

    \[\leadsto x \]

Developer target: 97.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (< x -9.025511195533005e-135)
   (- x (* (/ z t) (- x y)))
   (if (< x 4.275032163700715e-250)
     (+ x (* (/ (- y x) t) z))
     (+ x (/ (- y x) (/ t z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x < -9.025511195533005e-135) {
		tmp = x - ((z / t) * (x - y));
	} else if (x < 4.275032163700715e-250) {
		tmp = x + (((y - x) / t) * z);
	} else {
		tmp = x + ((y - x) / (t / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x < (-9.025511195533005d-135)) then
        tmp = x - ((z / t) * (x - y))
    else if (x < 4.275032163700715d-250) then
        tmp = x + (((y - x) / t) * z)
    else
        tmp = x + ((y - x) / (t / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x < -9.025511195533005e-135) {
		tmp = x - ((z / t) * (x - y));
	} else if (x < 4.275032163700715e-250) {
		tmp = x + (((y - x) / t) * z);
	} else {
		tmp = x + ((y - x) / (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x < -9.025511195533005e-135:
		tmp = x - ((z / t) * (x - y))
	elif x < 4.275032163700715e-250:
		tmp = x + (((y - x) / t) * z)
	else:
		tmp = x + ((y - x) / (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x < -9.025511195533005e-135)
		tmp = Float64(x - Float64(Float64(z / t) * Float64(x - y)));
	elseif (x < 4.275032163700715e-250)
		tmp = Float64(x + Float64(Float64(Float64(y - x) / t) * z));
	else
		tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x < -9.025511195533005e-135)
		tmp = x - ((z / t) * (x - y));
	elseif (x < 4.275032163700715e-250)
		tmp = x + (((y - x) / t) * z);
	else
		tmp = x + ((y - x) / (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Less[x, -9.025511195533005e-135], N[(x - N[(N[(z / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[x, 4.275032163700715e-250], N[(x + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
\;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\

\mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023297 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

  (+ x (/ (* (- y x) z) t)))