Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B

Percentage Accurate: 99.9% → 99.9%
Time: 9.5s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\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 14 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: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
    5. associate--l+N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
    7. associate-+l-N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
    9. --lowering--.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
  4. Add Preprocessing
  5. Final simplification100.0%

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

Alternative 2: 87.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{x - z}{t}}{2}\\
\mathbf{if}\;z \leq -0.2:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{x + y}{t}}{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.20000000000000001 or 1.4e20 < z

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(x - z\right), t\right), 2\right) \]
      2. --lowering--.f6485.1%

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

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

    if -0.20000000000000001 < z < 1.4e20

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x + y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 \cdot x + y}{t}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(-1 \cdot -1\right) \cdot x + y}{t}\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + y}{t}\right), 2\right) \]
      4. *-lft-identityN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + \left(-1 \cdot -1\right) \cdot y}{t}\right), 2\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + -1 \cdot \left(-1 \cdot y\right)}{t}\right), 2\right) \]
      7. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x + -1 \cdot y\right)}{t}\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot \left(x + y\right)\right)}{t}\right), 2\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(\left(-1 \cdot \left(x + y\right)\right) \cdot 1\right)}{t}\right), 2\right) \]
      10. *-inversesN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(\frac{-1 \cdot \left(x + y\right)}{z} \cdot z\right)}{t}\right), 2\right) \]
      13. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{z}\right)\right)}{t}\right), 2\right) \]
      15. neg-mul-1N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{z}\right)\right)\right), t\right), 2\right) \]
    7. Simplified91.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.2:\\ \;\;\;\;\frac{\frac{x - z}{t}}{2}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{x + y}{t}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x - z}{t}}{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 87.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{0.5}{t} \cdot \left(x - z\right)\\
\mathbf{if}\;z \leq -0.13:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.6 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{x + y}{t}}{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.13 or 9.6e19 < z

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l/N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \left(x - \left(z - y\right)\right)\right) \]
      8. sub-negN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(0 - \left(\left(\mathsf{neg}\left(y\right)\right) + \color{blue}{z}\right)\right)\right)\right) \]
      13. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(0 - \left(\mathsf{neg}\left(y\right)\right)\right) - \color{blue}{z}\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) - z\right)\right)\right) \]
      15. remove-double-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(y, \color{blue}{z}\right)\right)\right) \]
    6. Applied egg-rr99.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \color{blue}{\left(x - z\right)}\right) \]
    8. Step-by-step derivation
      1. --lowering--.f6485.0%

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

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

    if -0.13 < z < 9.6e19

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x + y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 \cdot x + y}{t}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(-1 \cdot -1\right) \cdot x + y}{t}\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + y}{t}\right), 2\right) \]
      4. *-lft-identityN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + \left(-1 \cdot -1\right) \cdot y}{t}\right), 2\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + -1 \cdot \left(-1 \cdot y\right)}{t}\right), 2\right) \]
      7. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x + -1 \cdot y\right)}{t}\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot \left(x + y\right)\right)}{t}\right), 2\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(\left(-1 \cdot \left(x + y\right)\right) \cdot 1\right)}{t}\right), 2\right) \]
      10. *-inversesN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(\frac{-1 \cdot \left(x + y\right)}{z} \cdot z\right)}{t}\right), 2\right) \]
      13. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{z}\right)\right)}{t}\right), 2\right) \]
      15. neg-mul-1N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{z}\right)\right)\right), t\right), 2\right) \]
    7. Simplified91.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.13:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{+19}:\\ \;\;\;\;\frac{\frac{x + y}{t}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 87.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{0.5}{t} \cdot \left(x - z\right)\\
\mathbf{if}\;z \leq -0.0037:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+19}:\\
\;\;\;\;\frac{0.5}{\frac{t}{x + y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.0037000000000000002 or 1.35e19 < z

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l/N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \left(x - \left(z - y\right)\right)\right) \]
      8. sub-negN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(0 - \left(\left(\mathsf{neg}\left(y\right)\right) + \color{blue}{z}\right)\right)\right)\right) \]
      13. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(0 - \left(\mathsf{neg}\left(y\right)\right)\right) - \color{blue}{z}\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) - z\right)\right)\right) \]
      15. remove-double-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(y, \color{blue}{z}\right)\right)\right) \]
    6. Applied egg-rr99.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \color{blue}{\left(x - z\right)}\right) \]
    8. Step-by-step derivation
      1. --lowering--.f6485.0%

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

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

    if -0.0037000000000000002 < z < 1.35e19

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x + y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 \cdot x + y}{t}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(-1 \cdot -1\right) \cdot x + y}{t}\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + y}{t}\right), 2\right) \]
      4. *-lft-identityN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + \left(-1 \cdot -1\right) \cdot y}{t}\right), 2\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x\right) + -1 \cdot \left(-1 \cdot y\right)}{t}\right), 2\right) \]
      7. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot x + -1 \cdot y\right)}{t}\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(-1 \cdot \left(x + y\right)\right)}{t}\right), 2\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(\left(-1 \cdot \left(x + y\right)\right) \cdot 1\right)}{t}\right), 2\right) \]
      10. *-inversesN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(\frac{-1 \cdot \left(x + y\right)}{z} \cdot z\right)}{t}\right), 2\right) \]
      13. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{z}\right)\right)}{t}\right), 2\right) \]
      15. neg-mul-1N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{z}\right)\right)\right), t\right), 2\right) \]
    7. Simplified91.1%

      \[\leadsto \frac{\color{blue}{\frac{y + x}{t}}}{2} \]
    8. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \frac{1}{\frac{t}{y + x}} \cdot \frac{\color{blue}{1}}{2} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{t}{y + x}} \cdot \frac{1}{2} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{t}{y + x}}} \]
      5. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(t, \left(x + \color{blue}{y}\right)\right)\right) \]
      9. +-lowering-+.f6490.8%

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(t, \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    9. Applied egg-rr90.8%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{x + y}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 46.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{2}\\

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-162}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.75e31

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6461.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, t\right), 2\right) \]
    7. Simplified61.0%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{2} \]

    if -1.75e31 < x < 2.2999999999999998e-162

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

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

        \[\leadsto \frac{\frac{-1}{2} \cdot z}{\color{blue}{t}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{\left(\frac{1}{2} \cdot -1\right) \cdot z}{t} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{2} \cdot \left(-1 \cdot z\right)}{t} \]
      4. mul-1-negN/A

        \[\leadsto \frac{\frac{1}{2} \cdot \left(\mathsf{neg}\left(z\right)\right)}{t} \]
      5. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(-1 \cdot z\right)\right), t\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot -1\right) \cdot z\right), t\right) \]
      8. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot \frac{-1}{2}\right), t\right) \]
      10. *-lowering-*.f6447.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \frac{-1}{2}\right), t\right) \]
    7. Simplified47.4%

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

    if 2.2999999999999998e-162 < x

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6431.0%

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

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

Alternative 6: 46.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{2}\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{-159}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.1000000000000002e31

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6461.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, t\right), 2\right) \]
    7. Simplified61.0%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{2} \]

    if -3.1000000000000002e31 < x < 1.14999999999999989e-159

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

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

        \[\leadsto \frac{\frac{-1}{2} \cdot z}{\color{blue}{t}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{\left(\frac{1}{2} \cdot -1\right) \cdot z}{t} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{2} \cdot \left(-1 \cdot z\right)}{t} \]
      4. mul-1-negN/A

        \[\leadsto \frac{\frac{1}{2} \cdot \left(\mathsf{neg}\left(z\right)\right)}{t} \]
      5. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(-1 \cdot z\right)\right), t\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot -1\right) \cdot z\right), t\right) \]
      8. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot \frac{-1}{2}\right), t\right) \]
      10. *-lowering-*.f6447.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \frac{-1}{2}\right), t\right) \]
    7. Simplified47.4%

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

    if 1.14999999999999989e-159 < x

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6431.0%

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

      \[\leadsto \frac{\color{blue}{\frac{y}{t}}}{2} \]
    8. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \frac{1}{\frac{t}{y}} \cdot \frac{\color{blue}{1}}{2} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{t}{y}} \cdot \frac{1}{2} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{t}{y}}} \]
      5. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{t}{y}\right)}\right) \]
      7. /-lowering-/.f6431.0%

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

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

Alternative 7: 46.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+31}:\\
\;\;\;\;\frac{0.5}{\frac{t}{x}}\\

\mathbf{elif}\;x \leq 10^{-160}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2000000000000001e31

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x}{t}} \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \frac{1}{2} \cdot \frac{1 \cdot x}{t} \]
      2. associate-*l/N/A

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

        \[\leadsto \left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot \color{blue}{x} \]
      4. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{t}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2}}{t}\right)\right) \]
      8. /-lowering-/.f6460.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{t}\right)\right) \]
    7. Simplified60.8%

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

        \[\leadsto \frac{x \cdot \frac{1}{2}}{\color{blue}{t}} \]
      2. associate-*l/N/A

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

        \[\leadsto \frac{1}{\frac{t}{x}} \cdot \frac{1}{2} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{t}{x}}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{t}}{x}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{t}{x}\right)}\right) \]
      7. /-lowering-/.f6460.9%

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(t, \color{blue}{x}\right)\right) \]
    9. Applied egg-rr60.9%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{x}}} \]

    if -2.2000000000000001e31 < x < 9.9999999999999999e-161

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

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

        \[\leadsto \frac{\frac{-1}{2} \cdot z}{\color{blue}{t}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{\left(\frac{1}{2} \cdot -1\right) \cdot z}{t} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{2} \cdot \left(-1 \cdot z\right)}{t} \]
      4. mul-1-negN/A

        \[\leadsto \frac{\frac{1}{2} \cdot \left(\mathsf{neg}\left(z\right)\right)}{t} \]
      5. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(-1 \cdot z\right)\right), t\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot -1\right) \cdot z\right), t\right) \]
      8. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(z \cdot \frac{-1}{2}\right), t\right) \]
      10. *-lowering-*.f6447.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(z, \frac{-1}{2}\right), t\right) \]
    7. Simplified47.4%

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

    if 9.9999999999999999e-161 < x

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6431.0%

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

      \[\leadsto \frac{\color{blue}{\frac{y}{t}}}{2} \]
    8. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \frac{1}{\frac{t}{y}} \cdot \frac{\color{blue}{1}}{2} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{t}{y}} \cdot \frac{1}{2} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{t}{y}}} \]
      5. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{t}{y}\right)}\right) \]
      7. /-lowering-/.f6431.0%

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

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

Alternative 8: 46.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+31}:\\
\;\;\;\;\frac{0.5}{\frac{t}{x}}\\

\mathbf{elif}\;x \leq 10^{-159}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.40000000000000008e31

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x}{t}} \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \frac{1}{2} \cdot \frac{1 \cdot x}{t} \]
      2. associate-*l/N/A

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

        \[\leadsto \left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot \color{blue}{x} \]
      4. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{t}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2}}{t}\right)\right) \]
      8. /-lowering-/.f6460.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{t}\right)\right) \]
    7. Simplified60.8%

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

        \[\leadsto \frac{x \cdot \frac{1}{2}}{\color{blue}{t}} \]
      2. associate-*l/N/A

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

        \[\leadsto \frac{1}{\frac{t}{x}} \cdot \frac{1}{2} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{t}{x}}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{t}}{x}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{t}{x}\right)}\right) \]
      7. /-lowering-/.f6460.9%

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(t, \color{blue}{x}\right)\right) \]
    9. Applied egg-rr60.9%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{x}}} \]

    if -1.40000000000000008e31 < x < 9.99999999999999989e-160

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, t\right), \mathsf{/.f64}\left(\left(z - y\right), t\right)\right), 2\right) \]
      5. --lowering--.f64100.0%

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

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
    8. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \frac{\color{blue}{z}}{t} \]
      2. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \frac{z}{t}\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \frac{1 \cdot z}{t}\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \left(\frac{1}{t} \cdot z\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot z\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)}\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{t}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{t}\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\color{blue}{t}}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\frac{-1}{2}}{t}\right)\right) \]
      13. /-lowering-/.f6447.4%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\frac{-1}{2}, \color{blue}{t}\right)\right) \]
    9. Simplified47.4%

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

    if 9.99999999999999989e-160 < x

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6431.0%

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

      \[\leadsto \frac{\color{blue}{\frac{y}{t}}}{2} \]
    8. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \frac{1}{\frac{t}{y}} \cdot \frac{\color{blue}{1}}{2} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{t}{y}} \cdot \frac{1}{2} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{t}{y}}} \]
      5. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{t}{y}\right)}\right) \]
      7. /-lowering-/.f6431.0%

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

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

Alternative 9: 68.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < -1.9999999999999999e-240

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0

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

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

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

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

    if -1.9999999999999999e-240 < (+.f64 x y)

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

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

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

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

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

Alternative 10: 75.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.2000000000000001e154

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l/N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \left(x - \left(z - y\right)\right)\right) \]
      8. sub-negN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(0 - \left(\left(\mathsf{neg}\left(y\right)\right) + \color{blue}{z}\right)\right)\right)\right) \]
      13. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(0 - \left(\mathsf{neg}\left(y\right)\right)\right) - \color{blue}{z}\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) - z\right)\right)\right) \]
      15. remove-double-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(y, \color{blue}{z}\right)\right)\right) \]
    6. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \color{blue}{\left(x - z\right)}\right) \]
    8. Step-by-step derivation
      1. --lowering--.f6469.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{\_.f64}\left(x, \color{blue}{z}\right)\right) \]
    9. Simplified69.8%

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

    if 2.2000000000000001e154 < y

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{t}\right)}, 2\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6472.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, t\right), 2\right) \]
    7. Simplified72.1%

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

Alternative 11: 46.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.19999999999999991e31

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x}{t}} \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \frac{1}{2} \cdot \frac{1 \cdot x}{t} \]
      2. associate-*l/N/A

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

        \[\leadsto \left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot \color{blue}{x} \]
      4. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{t}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2}}{t}\right)\right) \]
      8. /-lowering-/.f6460.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{t}\right)\right) \]
    7. Simplified60.8%

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

        \[\leadsto \frac{x \cdot \frac{1}{2}}{\color{blue}{t}} \]
      2. associate-*l/N/A

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

        \[\leadsto \frac{1}{\frac{t}{x}} \cdot \frac{1}{2} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1}{2}}{\color{blue}{\frac{t}{x}}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{t}}{x}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{t}{x}\right)}\right) \]
      7. /-lowering-/.f6460.9%

        \[\leadsto \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(t, \color{blue}{x}\right)\right) \]
    9. Applied egg-rr60.9%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{x}}} \]

    if -1.19999999999999991e31 < x

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
    8. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \frac{\color{blue}{z}}{t} \]
      2. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \frac{z}{t}\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \frac{1 \cdot z}{t}\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \left(\frac{1}{t} \cdot z\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot z\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)}\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{t}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{t}\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\color{blue}{t}}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\frac{-1}{2}}{t}\right)\right) \]
      13. /-lowering-/.f6441.9%

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

      \[\leadsto \color{blue}{z \cdot \frac{-0.5}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 46.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.64999999999999996e31

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x}{t}} \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \frac{1}{2} \cdot \frac{1 \cdot x}{t} \]
      2. associate-*l/N/A

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

        \[\leadsto \left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot \color{blue}{x} \]
      4. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{t}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2}}{t}\right)\right) \]
      8. /-lowering-/.f6460.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{t}\right)\right) \]
    7. Simplified60.8%

      \[\leadsto \color{blue}{x \cdot \frac{0.5}{t}} \]

    if -1.64999999999999996e31 < x

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
      5. associate--l+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
      7. associate-+l-N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
      9. --lowering--.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
    3. Simplified100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
    8. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \frac{\color{blue}{z}}{t} \]
      2. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \frac{z}{t}\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \frac{1 \cdot z}{t}\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{2} \cdot \left(\frac{1}{t} \cdot z\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot z\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)}\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{t}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{t}\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\color{blue}{t}}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\frac{-1}{2}}{t}\right)\right) \]
      13. /-lowering-/.f6441.9%

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

      \[\leadsto \color{blue}{z \cdot \frac{-0.5}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
    5. associate--l+N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
    7. associate-+l-N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
    9. --lowering--.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-/l/N/A

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \left(x - \left(z - y\right)\right)\right) \]
    8. sub-negN/A

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(0 - \left(\left(\mathsf{neg}\left(y\right)\right) + \color{blue}{z}\right)\right)\right)\right) \]
    13. associate--r+N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(0 - \left(\mathsf{neg}\left(y\right)\right)\right) - \color{blue}{z}\right)\right)\right) \]
    14. neg-sub0N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) - z\right)\right)\right) \]
    15. remove-double-negN/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, t\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(y, \color{blue}{z}\right)\right)\right) \]
  6. Applied egg-rr99.7%

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

Alternative 14: 37.9% accurate, 1.8× speedup?

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

\\
x \cdot \frac{0.5}{t}
\end{array}
Derivation
  1. Initial program 99.6%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(y + x\right) - z\right), t\right), 2\right) \]
    5. associate--l+N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x - z\right) + y\right), t\right), 2\right) \]
    7. associate-+l-N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(z - y\right)\right), t\right), 2\right) \]
    9. --lowering--.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(z, y\right)\right), t\right), 2\right) \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\frac{\frac{x - \left(z - y\right)}{t}}{2}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf

    \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x}{t}} \]
  6. Step-by-step derivation
    1. *-lft-identityN/A

      \[\leadsto \frac{1}{2} \cdot \frac{1 \cdot x}{t} \]
    2. associate-*l/N/A

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

      \[\leadsto \left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot \color{blue}{x} \]
    4. *-commutativeN/A

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

      \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right)}\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{t}}\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2}}{t}\right)\right) \]
    8. /-lowering-/.f6433.8%

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{t}\right)\right) \]
  7. Simplified33.8%

    \[\leadsto \color{blue}{x \cdot \frac{0.5}{t}} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024155 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B"
  :precision binary64
  (/ (- (+ x y) z) (* t 2.0)))