Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.4% → 97.5%
Time: 9.4s
Alternatives: 11
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 11 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.4% 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: 97.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y - x}{\frac{t}{z}} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (- y x) (/ t z))))
double code(double x, double y, double z, double t) {
	return x + ((y - x) / (t / z));
}
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) / (t / z))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - x) / (t / z));
}
def code(x, y, z, t):
	return x + ((y - x) / (t / z))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - x) / Float64(t / z)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - x) / (t / z));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y - x}{\frac{t}{z}}
\end{array}
Derivation
  1. Initial program 93.0%

    \[x + \frac{\left(y - x\right) \cdot z}{t} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
    2. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
    3. associate-/l*N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
    4. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
    5. un-div-invN/A

      \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
    8. /-lowering-/.f6498.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
  4. Applied egg-rr98.0%

    \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
  5. Final simplification98.0%

    \[\leadsto x + \frac{y - x}{\frac{t}{z}} \]
  6. Add Preprocessing

Alternative 2: 83.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y}{\frac{t}{z}}\\ \mathbf{if}\;y \leq -8 \cdot 10^{+125}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-39}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq 1.92 \cdot 10^{-62}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (/ y (/ t z)))))
   (if (<= y -8e+125)
     t_1
     (if (<= y -1.75e-39)
       (* (- y x) (/ z t))
       (if (<= y 1.92e-62) (* x (- 1.0 (/ z t))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (y / (t / z));
	double tmp;
	if (y <= -8e+125) {
		tmp = t_1;
	} else if (y <= -1.75e-39) {
		tmp = (y - x) * (z / t);
	} else if (y <= 1.92e-62) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	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 = x + (y / (t / z))
    if (y <= (-8d+125)) then
        tmp = t_1
    else if (y <= (-1.75d-39)) then
        tmp = (y - x) * (z / t)
    else if (y <= 1.92d-62) then
        tmp = x * (1.0d0 - (z / t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (y / (t / z));
	double tmp;
	if (y <= -8e+125) {
		tmp = t_1;
	} else if (y <= -1.75e-39) {
		tmp = (y - x) * (z / t);
	} else if (y <= 1.92e-62) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (y / (t / z))
	tmp = 0
	if y <= -8e+125:
		tmp = t_1
	elif y <= -1.75e-39:
		tmp = (y - x) * (z / t)
	elif y <= 1.92e-62:
		tmp = x * (1.0 - (z / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(y / Float64(t / z)))
	tmp = 0.0
	if (y <= -8e+125)
		tmp = t_1;
	elseif (y <= -1.75e-39)
		tmp = Float64(Float64(y - x) * Float64(z / t));
	elseif (y <= 1.92e-62)
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (y / (t / z));
	tmp = 0.0;
	if (y <= -8e+125)
		tmp = t_1;
	elseif (y <= -1.75e-39)
		tmp = (y - x) * (z / t);
	elseif (y <= 1.92e-62)
		tmp = x * (1.0 - (z / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e+125], t$95$1, If[LessEqual[y, -1.75e-39], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.92e-62], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 1.92 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.9999999999999994e125 or 1.92e-62 < y

    1. Initial program 92.0%

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

      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\frac{y \cdot z}{t}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right)\right) \]
      2. *-lowering-*.f6486.5%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, z\right), t\right)\right) \]
    5. Simplified86.5%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{y \cdot z}{t} + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y \cdot z}{t}\right), \color{blue}{x}\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(y \cdot \frac{z}{t}\right), x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\left(y \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y}{\frac{t}{z}}\right), x\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, \left(\frac{t}{z}\right)\right), x\right) \]
      7. /-lowering-/.f6492.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
    7. Applied egg-rr92.8%

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

    if -7.9999999999999994e125 < y < -1.75e-39

    1. Initial program 86.5%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      8. /-lowering-/.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
    4. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot \left(y - x\right)\right), \color{blue}{t}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \left(y - x\right)\right), t\right) \]
      3. --lowering--.f6472.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, x\right)\right), t\right) \]
    7. Simplified72.5%

      \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{z \cdot \left(y - x\right)}}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{1}{\frac{\frac{t}{y - x}}{\color{blue}{z}}} \]
      3. clear-numN/A

        \[\leadsto \frac{z}{\color{blue}{\frac{t}{y - x}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{z}{t} \cdot \color{blue}{\left(y - x\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{z}{t}\right), \color{blue}{\left(y - x\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), \left(\color{blue}{y} - x\right)\right) \]
      7. --lowering--.f6485.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right) \]
    9. Applied egg-rr85.8%

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

    if -1.75e-39 < y < 1.92e-62

    1. Initial program 95.6%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\frac{z}{t}\right)\right)\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 - \color{blue}{\frac{z}{t}}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{z}{t}\right)}\right)\right) \]
      5. /-lowering-/.f6485.3%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \color{blue}{t}\right)\right)\right) \]
    5. Simplified85.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+125}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-39}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq 1.92 \cdot 10^{-62}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{t}\\ \mathbf{if}\;y \leq -1.2 \cdot 10^{+150}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-39}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{-58}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ z t)))))
   (if (<= y -1.2e+150)
     t_1
     (if (<= y -2.05e-39)
       (* (- y x) (/ z t))
       (if (<= y 1.52e-58) (* x (- 1.0 (/ z t))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (y * (z / t));
	double tmp;
	if (y <= -1.2e+150) {
		tmp = t_1;
	} else if (y <= -2.05e-39) {
		tmp = (y - x) * (z / t);
	} else if (y <= 1.52e-58) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	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 = x + (y * (z / t))
    if (y <= (-1.2d+150)) then
        tmp = t_1
    else if (y <= (-2.05d-39)) then
        tmp = (y - x) * (z / t)
    else if (y <= 1.52d-58) then
        tmp = x * (1.0d0 - (z / t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (y * (z / t));
	double tmp;
	if (y <= -1.2e+150) {
		tmp = t_1;
	} else if (y <= -2.05e-39) {
		tmp = (y - x) * (z / t);
	} else if (y <= 1.52e-58) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (y * (z / t))
	tmp = 0
	if y <= -1.2e+150:
		tmp = t_1
	elif y <= -2.05e-39:
		tmp = (y - x) * (z / t)
	elif y <= 1.52e-58:
		tmp = x * (1.0 - (z / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(y * Float64(z / t)))
	tmp = 0.0
	if (y <= -1.2e+150)
		tmp = t_1;
	elseif (y <= -2.05e-39)
		tmp = Float64(Float64(y - x) * Float64(z / t));
	elseif (y <= 1.52e-58)
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (y * (z / t));
	tmp = 0.0;
	if (y <= -1.2e+150)
		tmp = t_1;
	elseif (y <= -2.05e-39)
		tmp = (y - x) * (z / t);
	elseif (y <= 1.52e-58)
		tmp = x * (1.0 - (z / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e+150], t$95$1, If[LessEqual[y, -2.05e-39], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.52e-58], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 1.52 \cdot 10^{-58}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.20000000000000001e150 or 1.51999999999999993e-58 < y

    1. Initial program 91.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\frac{y \cdot z}{t}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right)\right) \]
      2. *-lowering-*.f6486.1%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, z\right), t\right)\right) \]
    5. Simplified86.1%

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

        \[\leadsto \mathsf{+.f64}\left(x, \left(y \cdot \color{blue}{\frac{z}{t}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{z}{t} \cdot \color{blue}{y}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(\frac{z}{t}\right), \color{blue}{y}\right)\right) \]
      4. /-lowering-/.f6492.5%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), y\right)\right) \]
    7. Applied egg-rr92.5%

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

    if -1.20000000000000001e150 < y < -2.05e-39

    1. Initial program 87.9%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      8. /-lowering-/.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot \left(y - x\right)\right), \color{blue}{t}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \left(y - x\right)\right), t\right) \]
      3. --lowering--.f6475.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, x\right)\right), t\right) \]
    7. Simplified75.2%

      \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{z \cdot \left(y - x\right)}}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{1}{\frac{\frac{t}{y - x}}{\color{blue}{z}}} \]
      3. clear-numN/A

        \[\leadsto \frac{z}{\color{blue}{\frac{t}{y - x}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{z}{t} \cdot \color{blue}{\left(y - x\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{z}{t}\right), \color{blue}{\left(y - x\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), \left(\color{blue}{y} - x\right)\right) \]
      7. --lowering--.f6487.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right) \]
    9. Applied egg-rr87.2%

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

    if -2.05e-39 < y < 1.51999999999999993e-58

    1. Initial program 95.6%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\frac{z}{t}\right)\right)\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 - \color{blue}{\frac{z}{t}}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{z}{t}\right)}\right)\right) \]
      5. /-lowering-/.f6485.3%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \color{blue}{t}\right)\right)\right) \]
    5. Simplified85.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+150}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-39}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{-58}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y}{\frac{t}{z}}\\ \mathbf{if}\;t \leq -1.7 \cdot 10^{-32}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+51}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (/ y (/ t z)))))
   (if (<= t -1.7e-32) t_1 (if (<= t 1.3e+51) (/ (* (- y x) z) t) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (y / (t / z));
	double tmp;
	if (t <= -1.7e-32) {
		tmp = t_1;
	} else if (t <= 1.3e+51) {
		tmp = ((y - x) * z) / t;
	} else {
		tmp = t_1;
	}
	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 = x + (y / (t / z))
    if (t <= (-1.7d-32)) then
        tmp = t_1
    else if (t <= 1.3d+51) then
        tmp = ((y - x) * z) / t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (y / (t / z));
	double tmp;
	if (t <= -1.7e-32) {
		tmp = t_1;
	} else if (t <= 1.3e+51) {
		tmp = ((y - x) * z) / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (y / (t / z))
	tmp = 0
	if t <= -1.7e-32:
		tmp = t_1
	elif t <= 1.3e+51:
		tmp = ((y - x) * z) / t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(y / Float64(t / z)))
	tmp = 0.0
	if (t <= -1.7e-32)
		tmp = t_1;
	elseif (t <= 1.3e+51)
		tmp = Float64(Float64(Float64(y - x) * z) / t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (y / (t / z));
	tmp = 0.0;
	if (t <= -1.7e-32)
		tmp = t_1;
	elseif (t <= 1.3e+51)
		tmp = ((y - x) * z) / t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e-32], t$95$1, If[LessEqual[t, 1.3e+51], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.69999999999999989e-32 or 1.3000000000000001e51 < t

    1. Initial program 86.4%

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

      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\frac{y \cdot z}{t}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right)\right) \]
      2. *-lowering-*.f6481.4%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, z\right), t\right)\right) \]
    5. Simplified81.4%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{y \cdot z}{t} + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y \cdot z}{t}\right), \color{blue}{x}\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(y \cdot \frac{z}{t}\right), x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\left(y \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y}{\frac{t}{z}}\right), x\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, \left(\frac{t}{z}\right)\right), x\right) \]
      7. /-lowering-/.f6489.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
    7. Applied egg-rr89.3%

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

    if -1.69999999999999989e-32 < t < 1.3000000000000001e51

    1. Initial program 98.5%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      8. /-lowering-/.f6497.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
    4. Applied egg-rr97.1%

      \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot \left(y - x\right)\right), \color{blue}{t}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \left(y - x\right)\right), t\right) \]
      3. --lowering--.f6486.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, x\right)\right), t\right) \]
    7. Simplified86.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{-32}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+51}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y - x}{t}\\ \mathbf{if}\;z \leq -4.3 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.7 \cdot 10^{-115}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ (- y x) t))))
   (if (<= z -4.3e+24) t_1 (if (<= z 7.7e-115) (* x (- 1.0 (/ z t))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = z * ((y - x) / t);
	double tmp;
	if (z <= -4.3e+24) {
		tmp = t_1;
	} else if (z <= 7.7e-115) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	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 = z * ((y - x) / t)
    if (z <= (-4.3d+24)) then
        tmp = t_1
    else if (z <= 7.7d-115) then
        tmp = x * (1.0d0 - (z / t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * ((y - x) / t);
	double tmp;
	if (z <= -4.3e+24) {
		tmp = t_1;
	} else if (z <= 7.7e-115) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * ((y - x) / t)
	tmp = 0
	if z <= -4.3e+24:
		tmp = t_1
	elif z <= 7.7e-115:
		tmp = x * (1.0 - (z / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(Float64(y - x) / t))
	tmp = 0.0
	if (z <= -4.3e+24)
		tmp = t_1;
	elseif (z <= 7.7e-115)
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * ((y - x) / t);
	tmp = 0.0;
	if (z <= -4.3e+24)
		tmp = t_1;
	elseif (z <= 7.7e-115)
		tmp = x * (1.0 - (z / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+24], t$95$1, If[LessEqual[z, 7.7e-115], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{y - x}{t}\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.29999999999999987e24 or 7.7000000000000002e-115 < z

    1. Initial program 89.3%

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto z \cdot \frac{y - x}{\color{blue}{t}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{y - x}{t}\right)}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{t}\right)\right) \]
      4. --lowering--.f6485.8%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), t\right)\right) \]
    5. Simplified85.8%

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

    if -4.29999999999999987e24 < z < 7.7000000000000002e-115

    1. Initial program 98.9%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\frac{z}{t}\right)\right)\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 - \color{blue}{\frac{z}{t}}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{z}{t}\right)}\right)\right) \]
      5. /-lowering-/.f6478.3%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \color{blue}{t}\right)\right)\right) \]
    5. Simplified78.3%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 73.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{\frac{t}{z}}\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+33}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ y (/ t z))))
   (if (<= y -5.5e+67) t_1 (if (<= y 7.2e+33) (* x (- 1.0 (/ z t))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = y / (t / z);
	double tmp;
	if (y <= -5.5e+67) {
		tmp = t_1;
	} else if (y <= 7.2e+33) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	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 / (t / z)
    if (y <= (-5.5d+67)) then
        tmp = t_1
    else if (y <= 7.2d+33) then
        tmp = x * (1.0d0 - (z / t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y / (t / z);
	double tmp;
	if (y <= -5.5e+67) {
		tmp = t_1;
	} else if (y <= 7.2e+33) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y / (t / z)
	tmp = 0
	if y <= -5.5e+67:
		tmp = t_1
	elif y <= 7.2e+33:
		tmp = x * (1.0 - (z / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y / Float64(t / z))
	tmp = 0.0
	if (y <= -5.5e+67)
		tmp = t_1;
	elseif (y <= 7.2e+33)
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y / (t / z);
	tmp = 0.0;
	if (y <= -5.5e+67)
		tmp = t_1;
	elseif (y <= 7.2e+33)
		tmp = x * (1.0 - (z / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+67], t$95$1, If[LessEqual[y, 7.2e+33], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.49999999999999968e67 or 7.2000000000000005e33 < y

    1. Initial program 90.8%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      8. /-lowering-/.f6499.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot y\right), t\right) \]
      3. *-lowering-*.f6465.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, y\right), t\right) \]
    7. Simplified65.5%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    8. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
      3. /-rgt-identityN/A

        \[\leadsto \frac{\frac{y}{t}}{1} \cdot z \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{y}{t}}{\color{blue}{\frac{1}{z}}} \]
      5. associate-/l/N/A

        \[\leadsto \frac{y}{\color{blue}{\frac{1}{z} \cdot t}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(\frac{1}{z} \cdot t\right)}\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(t \cdot \color{blue}{\frac{1}{z}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(\frac{t}{\color{blue}{z}}\right)\right) \]
      9. /-lowering-/.f6472.0%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right) \]
    9. Applied egg-rr72.0%

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

    if -5.49999999999999968e67 < y < 7.2000000000000005e33

    1. Initial program 94.6%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\frac{z}{t}\right)\right)\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(1 - \color{blue}{\frac{z}{t}}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{z}{t}\right)}\right)\right) \]
      5. /-lowering-/.f6480.1%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \color{blue}{t}\right)\right)\right) \]
    5. Simplified80.1%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 53.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+24}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-115}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -5.8e+24) (/ y (/ t z)) (if (<= z 2e-115) x (/ z (/ t y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -5.8e+24) {
		tmp = y / (t / z);
	} else if (z <= 2e-115) {
		tmp = x;
	} else {
		tmp = z / (t / y);
	}
	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 <= (-5.8d+24)) then
        tmp = y / (t / z)
    else if (z <= 2d-115) then
        tmp = x
    else
        tmp = z / (t / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -5.8e+24) {
		tmp = y / (t / z);
	} else if (z <= 2e-115) {
		tmp = x;
	} else {
		tmp = z / (t / y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -5.8e+24:
		tmp = y / (t / z)
	elif z <= 2e-115:
		tmp = x
	else:
		tmp = z / (t / y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -5.8e+24)
		tmp = Float64(y / Float64(t / z));
	elseif (z <= 2e-115)
		tmp = x;
	else
		tmp = Float64(z / Float64(t / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -5.8e+24)
		tmp = y / (t / z);
	elseif (z <= 2e-115)
		tmp = x;
	else
		tmp = z / (t / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.8e+24], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-115], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 2 \cdot 10^{-115}:\\
\;\;\;\;x\\

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


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

    1. Initial program 86.0%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
      8. /-lowering-/.f6498.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
    4. Applied egg-rr98.5%

      \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot y\right), t\right) \]
      3. *-lowering-*.f6453.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, y\right), t\right) \]
    7. Simplified53.0%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    8. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
      3. /-rgt-identityN/A

        \[\leadsto \frac{\frac{y}{t}}{1} \cdot z \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{y}{t}}{\color{blue}{\frac{1}{z}}} \]
      5. associate-/l/N/A

        \[\leadsto \frac{y}{\color{blue}{\frac{1}{z} \cdot t}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(\frac{1}{z} \cdot t\right)}\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(t \cdot \color{blue}{\frac{1}{z}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(\frac{t}{\color{blue}{z}}\right)\right) \]
      9. /-lowering-/.f6461.2%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right) \]
    9. Applied egg-rr61.2%

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

    if -5.79999999999999958e24 < z < 2.0000000000000001e-115

    1. Initial program 98.9%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified65.8%

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

      if 2.0000000000000001e-115 < z

      1. Initial program 91.6%

        \[x + \frac{\left(y - x\right) \cdot z}{t} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
        3. associate-/l*N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
        4. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
        5. un-div-invN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
        8. /-lowering-/.f6496.7%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
      4. Applied egg-rr96.7%

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
      5. Taylor expanded in y around inf

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\left(z \cdot y\right), t\right) \]
        3. *-lowering-*.f6448.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, y\right), t\right) \]
      7. Simplified48.6%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
        2. clear-numN/A

          \[\leadsto z \cdot \frac{1}{\color{blue}{\frac{t}{y}}} \]
        3. un-div-invN/A

          \[\leadsto \frac{z}{\color{blue}{\frac{t}{y}}} \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(z, \color{blue}{\left(\frac{t}{y}\right)}\right) \]
        5. /-lowering-/.f6453.7%

          \[\leadsto \mathsf{/.f64}\left(z, \mathsf{/.f64}\left(t, \color{blue}{y}\right)\right) \]
      9. Applied egg-rr53.7%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    5. Recombined 3 regimes into one program.
    6. Add Preprocessing

    Alternative 8: 54.4% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{\frac{t}{z}}\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-114}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (/ y (/ t z))))
       (if (<= z -2.2e+25) t_1 (if (<= z 1.15e-114) x t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = y / (t / z);
    	double tmp;
    	if (z <= -2.2e+25) {
    		tmp = t_1;
    	} else if (z <= 1.15e-114) {
    		tmp = x;
    	} else {
    		tmp = t_1;
    	}
    	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 / (t / z)
        if (z <= (-2.2d+25)) then
            tmp = t_1
        else if (z <= 1.15d-114) then
            tmp = x
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = y / (t / z);
    	double tmp;
    	if (z <= -2.2e+25) {
    		tmp = t_1;
    	} else if (z <= 1.15e-114) {
    		tmp = x;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = y / (t / z)
    	tmp = 0
    	if z <= -2.2e+25:
    		tmp = t_1
    	elif z <= 1.15e-114:
    		tmp = x
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(y / Float64(t / z))
    	tmp = 0.0
    	if (z <= -2.2e+25)
    		tmp = t_1;
    	elseif (z <= 1.15e-114)
    		tmp = x;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = y / (t / z);
    	tmp = 0.0;
    	if (z <= -2.2e+25)
    		tmp = t_1;
    	elseif (z <= 1.15e-114)
    		tmp = x;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+25], t$95$1, If[LessEqual[z, 1.15e-114], x, t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{y}{\frac{t}{z}}\\
    \mathbf{if}\;z \leq -2.2 \cdot 10^{+25}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 1.15 \cdot 10^{-114}:\\
    \;\;\;\;x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -2.2000000000000001e25 or 1.15e-114 < z

      1. Initial program 89.3%

        \[x + \frac{\left(y - x\right) \cdot z}{t} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
        3. associate-/l*N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
        4. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
        5. un-div-invN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
        8. /-lowering-/.f6497.5%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
      4. Applied egg-rr97.5%

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
      5. Taylor expanded in y around inf

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\left(z \cdot y\right), t\right) \]
        3. *-lowering-*.f6450.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, y\right), t\right) \]
      7. Simplified50.4%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
        3. /-rgt-identityN/A

          \[\leadsto \frac{\frac{y}{t}}{1} \cdot z \]
        4. associate-/r/N/A

          \[\leadsto \frac{\frac{y}{t}}{\color{blue}{\frac{1}{z}}} \]
        5. associate-/l/N/A

          \[\leadsto \frac{y}{\color{blue}{\frac{1}{z} \cdot t}} \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(\frac{1}{z} \cdot t\right)}\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(y, \left(t \cdot \color{blue}{\frac{1}{z}}\right)\right) \]
        8. div-invN/A

          \[\leadsto \mathsf{/.f64}\left(y, \left(\frac{t}{\color{blue}{z}}\right)\right) \]
        9. /-lowering-/.f6456.2%

          \[\leadsto \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right) \]
      9. Applied egg-rr56.2%

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

      if -2.2000000000000001e25 < z < 1.15e-114

      1. Initial program 98.9%

        \[x + \frac{\left(y - x\right) \cdot z}{t} \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \color{blue}{x} \]
      4. Step-by-step derivation
        1. Simplified65.8%

          \[\leadsto \color{blue}{x} \]
      5. Recombined 2 regimes into one program.
      6. Add Preprocessing

      Alternative 9: 54.5% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{t}\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-115}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* y (/ z t))))
         (if (<= z -5.8e+24) t_1 (if (<= z 7.4e-115) x t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = y * (z / t);
      	double tmp;
      	if (z <= -5.8e+24) {
      		tmp = t_1;
      	} else if (z <= 7.4e-115) {
      		tmp = x;
      	} else {
      		tmp = t_1;
      	}
      	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 (z <= (-5.8d+24)) then
              tmp = t_1
          else if (z <= 7.4d-115) then
              tmp = x
          else
              tmp = t_1
          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 (z <= -5.8e+24) {
      		tmp = t_1;
      	} else if (z <= 7.4e-115) {
      		tmp = x;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = y * (z / t)
      	tmp = 0
      	if z <= -5.8e+24:
      		tmp = t_1
      	elif z <= 7.4e-115:
      		tmp = x
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(y * Float64(z / t))
      	tmp = 0.0
      	if (z <= -5.8e+24)
      		tmp = t_1;
      	elseif (z <= 7.4e-115)
      		tmp = x;
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = y * (z / t);
      	tmp = 0.0;
      	if (z <= -5.8e+24)
      		tmp = t_1;
      	elseif (z <= 7.4e-115)
      		tmp = x;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+24], t$95$1, If[LessEqual[z, 7.4e-115], x, t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := y \cdot \frac{z}{t}\\
      \mathbf{if}\;z \leq -5.8 \cdot 10^{+24}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 7.4 \cdot 10^{-115}:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -5.79999999999999958e24 or 7.4e-115 < z

        1. Initial program 89.3%

          \[x + \frac{\left(y - x\right) \cdot z}{t} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \frac{\left(y - x\right) \cdot z}{t} + \color{blue}{x} \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\left(\frac{\left(y - x\right) \cdot z}{t}\right), \color{blue}{x}\right) \]
          3. associate-/l*N/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{z}{t}\right), x\right) \]
          4. clear-numN/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(y - x\right) \cdot \frac{1}{\frac{t}{z}}\right), x\right) \]
          5. un-div-invN/A

            \[\leadsto \mathsf{+.f64}\left(\left(\frac{y - x}{\frac{t}{z}}\right), x\right) \]
          6. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(y - x\right), \left(\frac{t}{z}\right)\right), x\right) \]
          7. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{t}{z}\right)\right), x\right) \]
          8. /-lowering-/.f6497.5%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(t, z\right)\right), x\right) \]
        4. Applied egg-rr97.5%

          \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x} \]
        5. Taylor expanded in y around inf

          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(y \cdot z\right), \color{blue}{t}\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\left(z \cdot y\right), t\right) \]
          3. *-lowering-*.f6450.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, y\right), t\right) \]
        7. Simplified50.4%

          \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
        8. Step-by-step derivation
          1. associate-*l/N/A

            \[\leadsto \frac{z}{t} \cdot \color{blue}{y} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\frac{z}{t}\right), \color{blue}{y}\right) \]
          3. /-lowering-/.f6456.2%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), y\right) \]
        9. Applied egg-rr56.2%

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

        if -5.79999999999999958e24 < z < 7.4e-115

        1. Initial program 98.9%

          \[x + \frac{\left(y - x\right) \cdot z}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified65.8%

            \[\leadsto \color{blue}{x} \]
        5. Recombined 2 regimes into one program.
        6. Final simplification59.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+24}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-115}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 10: 97.5% 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 93.0%

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

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\frac{z}{t}}\right)\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{z}{t} \cdot \color{blue}{\left(y - x\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(\frac{z}{t}\right), \color{blue}{\left(y - x\right)}\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), \left(\color{blue}{y} - x\right)\right)\right) \]
          5. --lowering--.f6498.0%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, t\right), \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right)\right) \]
        4. Applied egg-rr98.0%

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

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

        Alternative 11: 39.2% 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 93.0%

          \[x + \frac{\left(y - x\right) \cdot z}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified34.4%

            \[\leadsto \color{blue}{x} \]
          2. Add Preprocessing

          Developer Target 1: 97.3% accurate, 0.5× 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 2024158 
          (FPCore (x y z t)
            :name "Numeric.Histogram:binBounds from Chart-1.5.3"
            :precision binary64
          
            :alt
            (! :herbie-platform default (if (< x -1805102239106601/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- x (* (/ z t) (- x y))) (if (< x 855006432740143/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z))))))
          
            (+ x (/ (* (- y x) z) t)))