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

Percentage Accurate: 99.9% → 99.9%
Time: 6.7s
Alternatives: 9
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 9 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{\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}
Derivation
  1. Initial program 100.0%

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Add Preprocessing
  3. Final simplification100.0%

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

Alternative 2: 47.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -0.5 \cdot \frac{z}{t}\\ t_2 := 0.5 \cdot \frac{x}{t}\\ \mathbf{if}\;y \leq -2.7 \cdot 10^{-285}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-175}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+45}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* -0.5 (/ z t))) (t_2 (* 0.5 (/ x t))))
   (if (<= y -2.7e-285)
     t_2
     (if (<= y 4e-264)
       t_1
       (if (<= y 9e-175)
         t_2
         (if (<= y 2.2e-92)
           t_1
           (if (<= y 2.8e-47)
             t_2
             (if (<= y 3.2e+45) t_1 (* 0.5 (/ y t))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = -0.5 * (z / t);
	double t_2 = 0.5 * (x / t);
	double tmp;
	if (y <= -2.7e-285) {
		tmp = t_2;
	} else if (y <= 4e-264) {
		tmp = t_1;
	} else if (y <= 9e-175) {
		tmp = t_2;
	} else if (y <= 2.2e-92) {
		tmp = t_1;
	} else if (y <= 2.8e-47) {
		tmp = t_2;
	} else if (y <= 3.2e+45) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-0.5d0) * (z / t)
    t_2 = 0.5d0 * (x / t)
    if (y <= (-2.7d-285)) then
        tmp = t_2
    else if (y <= 4d-264) then
        tmp = t_1
    else if (y <= 9d-175) then
        tmp = t_2
    else if (y <= 2.2d-92) then
        tmp = t_1
    else if (y <= 2.8d-47) then
        tmp = t_2
    else if (y <= 3.2d+45) then
        tmp = t_1
    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 t_1 = -0.5 * (z / t);
	double t_2 = 0.5 * (x / t);
	double tmp;
	if (y <= -2.7e-285) {
		tmp = t_2;
	} else if (y <= 4e-264) {
		tmp = t_1;
	} else if (y <= 9e-175) {
		tmp = t_2;
	} else if (y <= 2.2e-92) {
		tmp = t_1;
	} else if (y <= 2.8e-47) {
		tmp = t_2;
	} else if (y <= 3.2e+45) {
		tmp = t_1;
	} else {
		tmp = 0.5 * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -0.5 * (z / t)
	t_2 = 0.5 * (x / t)
	tmp = 0
	if y <= -2.7e-285:
		tmp = t_2
	elif y <= 4e-264:
		tmp = t_1
	elif y <= 9e-175:
		tmp = t_2
	elif y <= 2.2e-92:
		tmp = t_1
	elif y <= 2.8e-47:
		tmp = t_2
	elif y <= 3.2e+45:
		tmp = t_1
	else:
		tmp = 0.5 * (y / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(-0.5 * Float64(z / t))
	t_2 = Float64(0.5 * Float64(x / t))
	tmp = 0.0
	if (y <= -2.7e-285)
		tmp = t_2;
	elseif (y <= 4e-264)
		tmp = t_1;
	elseif (y <= 9e-175)
		tmp = t_2;
	elseif (y <= 2.2e-92)
		tmp = t_1;
	elseif (y <= 2.8e-47)
		tmp = t_2;
	elseif (y <= 3.2e+45)
		tmp = t_1;
	else
		tmp = Float64(0.5 * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -0.5 * (z / t);
	t_2 = 0.5 * (x / t);
	tmp = 0.0;
	if (y <= -2.7e-285)
		tmp = t_2;
	elseif (y <= 4e-264)
		tmp = t_1;
	elseif (y <= 9e-175)
		tmp = t_2;
	elseif (y <= 2.2e-92)
		tmp = t_1;
	elseif (y <= 2.8e-47)
		tmp = t_2;
	elseif (y <= 3.2e+45)
		tmp = t_1;
	else
		tmp = 0.5 * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.5 * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e-285], t$95$2, If[LessEqual[y, 4e-264], t$95$1, If[LessEqual[y, 9e-175], t$95$2, If[LessEqual[y, 2.2e-92], t$95$1, If[LessEqual[y, 2.8e-47], t$95$2, If[LessEqual[y, 3.2e+45], t$95$1, N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -0.5 \cdot \frac{z}{t}\\
t_2 := 0.5 \cdot \frac{x}{t}\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-285}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 4 \cdot 10^{-264}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 9 \cdot 10^{-175}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{-92}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{-47}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+45}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.6999999999999998e-285 or 4e-264 < y < 8.99999999999999996e-175 or 2.19999999999999987e-92 < y < 2.79999999999999993e-47

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.7%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.7%

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

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

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

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

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

    if -2.6999999999999998e-285 < y < 4e-264 or 8.99999999999999996e-175 < y < 2.19999999999999987e-92 or 2.79999999999999993e-47 < y < 3.2000000000000003e45

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.6%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.6%

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

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

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

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

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

    if 3.2000000000000003e45 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.7%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-285}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-264}:\\ \;\;\;\;-0.5 \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-175}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-92}:\\ \;\;\;\;-0.5 \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-47}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+45}:\\ \;\;\;\;-0.5 \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 74.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.25 \cdot 10^{+127} \lor \neg \left(x \leq -1.55 \cdot 10^{+107}\right) \land x \leq -4.5 \cdot 10^{+69}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{z - y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -4.25e+127) (and (not (<= x -1.55e+107)) (<= x -4.5e+69)))
   (* 0.5 (/ x t))
   (* -0.5 (/ (- z y) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4.25e+127) || (!(x <= -1.55e+107) && (x <= -4.5e+69))) {
		tmp = 0.5 * (x / t);
	} else {
		tmp = -0.5 * ((z - 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 <= (-4.25d+127)) .or. (.not. (x <= (-1.55d+107))) .and. (x <= (-4.5d+69))) then
        tmp = 0.5d0 * (x / t)
    else
        tmp = (-0.5d0) * ((z - y) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4.25e+127) || (!(x <= -1.55e+107) && (x <= -4.5e+69))) {
		tmp = 0.5 * (x / t);
	} else {
		tmp = -0.5 * ((z - y) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -4.25e+127) or (not (x <= -1.55e+107) and (x <= -4.5e+69)):
		tmp = 0.5 * (x / t)
	else:
		tmp = -0.5 * ((z - y) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -4.25e+127) || (!(x <= -1.55e+107) && (x <= -4.5e+69)))
		tmp = Float64(0.5 * Float64(x / t));
	else
		tmp = Float64(-0.5 * Float64(Float64(z - y) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -4.25e+127) || (~((x <= -1.55e+107)) && (x <= -4.5e+69)))
		tmp = 0.5 * (x / t);
	else
		tmp = -0.5 * ((z - y) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.25e+127], And[N[Not[LessEqual[x, -1.55e+107]], $MachinePrecision], LessEqual[x, -4.5e+69]]], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.25 \cdot 10^{+127} \lor \neg \left(x \leq -1.55 \cdot 10^{+107}\right) \land x \leq -4.5 \cdot 10^{+69}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.2499999999999998e127 or -1.55000000000000013e107 < x < -4.4999999999999999e69

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.8%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2499999999999998e127 < x < -1.55000000000000013e107 or -4.4999999999999999e69 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.7%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.25 \cdot 10^{+127} \lor \neg \left(x \leq -1.55 \cdot 10^{+107}\right) \land x \leq -4.5 \cdot 10^{+69}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{z - y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 56.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+72} \lor \neg \left(z \leq 1.35 \cdot 10^{+49}\right):\\
\;\;\;\;-0.5 \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1000000000000001e72 or 1.35000000000000005e49 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.7%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.7%

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

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

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

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

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

    if -2.1000000000000001e72 < z < 1.35000000000000005e49

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.7%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+72} \lor \neg \left(z \leq 1.35 \cdot 10^{+49}\right):\\ \;\;\;\;-0.5 \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.7%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.7%

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x + y}{t}} \]
    6. Step-by-step derivation
      1. associate-*r/81.9%

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

      \[\leadsto \color{blue}{\frac{0.5 \cdot \left(x + y\right)}{t}} \]
    8. Step-by-step derivation
      1. associate-/l*81.7%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{x + y}}} \]
      2. associate-/r/81.7%

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

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

    if -10 < (+.f64 x y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.7%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.7%

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

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

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

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

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

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

Alternative 6: 68.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.8%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(z - x\right)}{t}} \]
      2. associate-/l*68.2%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z - x}}} \]
    7. Simplified68.2%

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

    if -3.99999999999999976e-106 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.6%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.6%

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

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

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

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

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

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

Alternative 7: 68.5% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.8%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999976e-106 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
      12. associate-/l*99.6%

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

        \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
      14. /-rgt-identity99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
      21. *-commutative99.6%

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

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

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

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

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

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

Alternative 8: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
    12. associate-/l*99.7%

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

      \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
    14. /-rgt-identity99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
    21. *-commutative99.7%

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

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

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

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

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

Alternative 9: 37.4% accurate, 1.8× speedup?

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

\\
-0.5 \cdot \frac{z}{t}
\end{array}
Derivation
  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0 - \frac{\color{blue}{\left(\left(x + y\right) - z\right) \cdot -1}}{-1}\right) \cdot \frac{-1}{t \cdot 2} \]
    12. associate-/l*99.7%

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

      \[\leadsto \left(0 - \frac{\left(x + y\right) - z}{\color{blue}{1}}\right) \cdot \frac{-1}{t \cdot 2} \]
    14. /-rgt-identity99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(z - y\right) - x\right)} \cdot \frac{-1}{t \cdot 2} \]
    21. *-commutative99.7%

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

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

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

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

    \[\leadsto \color{blue}{-0.5 \cdot \frac{z}{t}} \]
  6. Final simplification35.7%

    \[\leadsto -0.5 \cdot \frac{z}{t} \]
  7. Add Preprocessing

Reproduce

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