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

Percentage Accurate: 100.0% → 99.7%
Time: 10.2s
Alternatives: 14
Speedup: N/A×

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: 100.0% 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.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. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t}} \cdot \left(\left(x + y\right) - z\right) \]
    11. metadata-eval99.7

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

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

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

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

      \[\leadsto \frac{\frac{1}{2}}{t} \cdot \color{blue}{\left(x + \left(y - z\right)\right)} \]
    16. lower--.f6499.7

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

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

Alternative 2: 5.3% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-\frac{x}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) < -3.99999999999999986e-274

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6430.8

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified30.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t} \cdot z} \]
      4. lower-*.f6430.7

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    7. Applied egg-rr30.7%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t}} \]
    9. Step-by-step derivation
      1. lower-/.f643.7

        \[\leadsto \color{blue}{\frac{-0.5}{t}} \]
    10. Simplified3.7%

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

    if -3.99999999999999986e-274 < (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64)))

    1. Initial program 99.3%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot x}}{t} \]
      5. lower-*.f6441.4

        \[\leadsto \frac{\color{blue}{0.5 \cdot x}}{t} \]
    5. Simplified41.4%

      \[\leadsto \color{blue}{\frac{0.5 \cdot x}{t}} \]
    6. Taylor expanded in x around -inf

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{t} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{t} \]
      2. lower-neg.f649.2

        \[\leadsto \frac{\color{blue}{-x}}{t} \]
    8. Simplified9.2%

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

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

Alternative 3: 48.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.0%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot x}}{t} \]
      5. lower-*.f6446.2

        \[\leadsto \frac{\color{blue}{0.5 \cdot x}}{t} \]
    5. Simplified46.2%

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

    if -4.9999999999999997e-12 < (+.f64 x y) < 1e-13

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6474.6

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified74.6%

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

    if 1e-13 < (+.f64 x y)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
      2. lower-/.f6442.7

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{t}} \]
    5. Simplified42.7%

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

Alternative 4: 48.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.0%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot x}}{t} \]
      5. lower-*.f6446.2

        \[\leadsto \frac{\color{blue}{0.5 \cdot x}}{t} \]
    5. Simplified46.2%

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

    if -4.9999999999999997e-12 < (+.f64 x y) < 1e-13

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6474.6

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified74.6%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t} \cdot z} \]
      4. lower-*.f6474.4

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    7. Applied egg-rr74.4%

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

    if 1e-13 < (+.f64 x y)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
      2. lower-/.f6442.7

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{t}} \]
    5. Simplified42.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.9%

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

Alternative 5: 48.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.0%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot x}}{t} \]
      5. lower-*.f6446.2

        \[\leadsto \frac{\color{blue}{0.5 \cdot x}}{t} \]
    5. Simplified46.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t} \cdot x} \]
      5. lower-*.f6446.1

        \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} \]
    7. Applied egg-rr46.1%

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

    if -4.9999999999999997e-12 < (+.f64 x y) < 1e-13

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6474.6

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified74.6%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t} \cdot z} \]
      4. lower-*.f6474.4

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    7. Applied egg-rr74.4%

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

    if 1e-13 < (+.f64 x y)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
      2. lower-/.f6442.7

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{t}} \]
    5. Simplified42.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.8%

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

Alternative 6: 81.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{+124}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x + y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.90000000000000001e175 or 1.85000000000000004e124 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6478.1

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified78.1%

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

    if -4.90000000000000001e175 < z < 1.85000000000000004e124

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t}} \cdot \left(\left(x + y\right) - z\right) \]
      11. metadata-eval99.6

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

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

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

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

        \[\leadsto \frac{\frac{1}{2}}{t} \cdot \color{blue}{\left(x + \left(y - z\right)\right)} \]
      16. lower--.f6499.6

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

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

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

        \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(x + y\right)} \]
    7. Simplified85.1%

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

Alternative 7: 43.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+164}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2000000000000001e176 or 4.40000000000000011e164 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6477.4

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified77.4%

      \[\leadsto \color{blue}{\frac{z \cdot -0.5}{t}} \]
    6. Taylor expanded in z around -inf

      \[\leadsto \frac{\color{blue}{-1 \cdot z}}{t} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(z\right)}}{t} \]
      2. lower-neg.f6453.5

        \[\leadsto \frac{\color{blue}{-z}}{t} \]
    8. Simplified53.5%

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

    if -1.2000000000000001e176 < z < 4.40000000000000011e164

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
      2. lower-/.f6443.9

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{t}} \]
    5. Simplified43.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+176}:\\ \;\;\;\;\frac{z}{-t}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+164}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{-t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 99.2%

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

      \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
    4. Step-by-step derivation
      1. lower--.f6467.1

        \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
    5. Simplified67.1%

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

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

        \[\leadsto \frac{x - z}{\color{blue}{t \cdot 2}} \]
      3. div-invN/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t} \cdot \left(x - z\right)} \]
      10. lower-*.f6466.9

        \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(x - z\right)} \]
    7. Applied egg-rr66.9%

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

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

    1. Initial program 100.0%

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

      \[\leadsto \frac{\color{blue}{y - z}}{t \cdot 2} \]
    4. Step-by-step derivation
      1. lower--.f6468.1

        \[\leadsto \frac{\color{blue}{y - z}}{t \cdot 2} \]
    5. Simplified68.1%

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

Alternative 9: 74.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 99.4%

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

      \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
    4. Step-by-step derivation
      1. lower--.f6470.5

        \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
    5. Simplified70.5%

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

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

        \[\leadsto \frac{x - z}{\color{blue}{t \cdot 2}} \]
      3. div-invN/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t} \cdot \left(x - z\right)} \]
      10. lower-*.f6470.3

        \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(x - z\right)} \]
    7. Applied egg-rr70.3%

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

    if 1e-13 < (+.f64 x y)

    1. Initial program 100.0%

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

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

        \[\leadsto \frac{\color{blue}{y + x}}{t \cdot 2} \]
      2. lower-+.f6484.5

        \[\leadsto \frac{\color{blue}{y + x}}{t \cdot 2} \]
    5. Simplified84.5%

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

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

Alternative 10: 74.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 99.4%

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

      \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
    4. Step-by-step derivation
      1. lower--.f6470.5

        \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
    5. Simplified70.5%

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

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

        \[\leadsto \frac{x - z}{\color{blue}{t \cdot 2}} \]
      3. div-invN/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t} \cdot \left(x - z\right)} \]
      10. lower-*.f6470.3

        \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(x - z\right)} \]
    7. Applied egg-rr70.3%

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

    if 1e-13 < (+.f64 x y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t}} \cdot \left(\left(x + y\right) - z\right) \]
      11. metadata-eval99.7

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

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

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

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

        \[\leadsto \frac{\frac{1}{2}}{t} \cdot \color{blue}{\left(x + \left(y - z\right)\right)} \]
      16. lower--.f6499.7

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

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

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

        \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(x + y\right)} \]
    7. Simplified84.2%

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

Alternative 11: 43.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6438.5

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified38.5%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t} \cdot z} \]
      4. lower-*.f6438.4

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    7. Applied egg-rr38.4%

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

    if 1e-13 < (+.f64 x y)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
      2. lower-/.f6442.7

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{t}} \]
    5. Simplified42.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.0%

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

Alternative 12: 5.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
      10. lower-*.f6431.6

        \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
    5. Simplified31.6%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t} \cdot z} \]
      4. lower-*.f6431.5

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    7. Applied egg-rr31.5%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t}} \]
    9. Step-by-step derivation
      1. lower-/.f646.0

        \[\leadsto \color{blue}{\frac{-0.5}{t}} \]
    10. Simplified6.0%

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

    if -2.2499999999999999e-154 < (-.f64 (+.f64 x y) z)

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot x}}{t} \]
      5. lower-*.f6441.6

        \[\leadsto \frac{\color{blue}{0.5 \cdot x}}{t} \]
    5. Simplified41.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t} \cdot x} \]
      5. lower-*.f6441.4

        \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} \]
    7. Applied egg-rr41.4%

      \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} \]
    8. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t}} \]
    9. Step-by-step derivation
      1. lower-/.f645.5

        \[\leadsto \color{blue}{\frac{0.5}{t}} \]
    10. Simplified5.5%

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

Alternative 13: 18.1% accurate, 1.6× speedup?

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

\\
\frac{z}{-t}
\end{array}
Derivation
  1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
    10. lower-*.f6432.5

      \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
  5. Simplified32.5%

    \[\leadsto \color{blue}{\frac{z \cdot -0.5}{t}} \]
  6. Taylor expanded in z around -inf

    \[\leadsto \frac{\color{blue}{-1 \cdot z}}{t} \]
  7. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(z\right)}}{t} \]
    2. lower-neg.f6418.7

      \[\leadsto \frac{\color{blue}{-z}}{t} \]
  8. Simplified18.7%

    \[\leadsto \frac{\color{blue}{-z}}{t} \]
  9. Final simplification18.7%

    \[\leadsto \frac{z}{-t} \]
  10. Add Preprocessing

Alternative 14: 3.5% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{z \cdot \frac{-1}{2}}}{t} \]
    10. lower-*.f6432.5

      \[\leadsto \frac{\color{blue}{z \cdot -0.5}}{t} \]
  5. Simplified32.5%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t} \cdot z} \]
    4. lower-*.f6432.4

      \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
  7. Applied egg-rr32.4%

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

    \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{t}} \]
  9. Step-by-step derivation
    1. lower-/.f643.8

      \[\leadsto \color{blue}{\frac{-0.5}{t}} \]
  10. Simplified3.8%

    \[\leadsto \color{blue}{\frac{-0.5}{t}} \]
  11. Add Preprocessing

Reproduce

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