Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A

Percentage Accurate: 99.5% → 99.8%
Time: 14.3s
Alternatives: 12
Speedup: 1.0×

Specification

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

\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{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 12 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.5% accurate, 1.0× speedup?

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

\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}

Alternative 1: 99.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (- (* x 0.5) y) (sqrt (* (exp (pow t 2.0)) (* 2.0 z)))))
double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * sqrt((exp(pow(t, 2.0)) * (2.0 * z)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * 0.5d0) - y) * sqrt((exp((t ** 2.0d0)) * (2.0d0 * z)))
end function
public static double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * Math.sqrt((Math.exp(Math.pow(t, 2.0)) * (2.0 * z)));
}
def code(x, y, z, t):
	return ((x * 0.5) - y) * math.sqrt((math.exp(math.pow(t, 2.0)) * (2.0 * z)))
function code(x, y, z, t)
	return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(exp((t ^ 2.0)) * Float64(2.0 * z))))
end
function tmp = code(x, y, z, t)
	tmp = ((x * 0.5) - y) * sqrt((exp((t ^ 2.0)) * (2.0 * z)));
end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[Exp[N[Power[t, 2.0], $MachinePrecision]], $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}
\end{array}
Derivation
  1. Initial program 98.2%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    2. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
    3. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    4. exp-sqrt99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    5. exp-prod99.8%

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

    \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. pow199.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)}^{1}} \]
    2. sqrt-unprod99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}\right)}}^{1} \]
    3. associate-*l*99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{\color{blue}{z \cdot \left(2 \cdot {\left(e^{t}\right)}^{t}\right)}}\right)}^{1} \]
    4. pow-exp99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \cdot \color{blue}{e^{t \cdot t}}\right)}\right)}^{1} \]
    5. pow299.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \cdot e^{\color{blue}{{t}^{2}}}\right)}\right)}^{1} \]
  6. Applied egg-rr99.8%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(\sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}\right)}^{1}} \]
  7. Step-by-step derivation
    1. unpow199.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}} \]
    2. *-commutative99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(2 \cdot e^{{t}^{2}}\right) \cdot z}} \]
    3. *-commutative99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(e^{{t}^{2}} \cdot 2\right)} \cdot z} \]
    4. associate-*l*99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}} \]
  8. Simplified99.8%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}} \]
  9. Final simplification99.8%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)} \]
  10. Add Preprocessing

Alternative 2: 59.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 12500:\\ \;\;\;\;t\_1 \cdot {\left(2 \cdot z\right)}^{0.5}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+222}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(t\_1 \cdot t\_1\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= t 12500.0)
     (* t_1 (pow (* 2.0 z) 0.5))
     (if (<= t 3.2e+222)
       (sqrt (* (* 2.0 z) (* t_1 t_1)))
       (* t_1 (cbrt (pow (* 2.0 z) 1.5)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 12500.0) {
		tmp = t_1 * pow((2.0 * z), 0.5);
	} else if (t <= 3.2e+222) {
		tmp = sqrt(((2.0 * z) * (t_1 * t_1)));
	} else {
		tmp = t_1 * cbrt(pow((2.0 * z), 1.5));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 12500.0) {
		tmp = t_1 * Math.pow((2.0 * z), 0.5);
	} else if (t <= 3.2e+222) {
		tmp = Math.sqrt(((2.0 * z) * (t_1 * t_1)));
	} else {
		tmp = t_1 * Math.cbrt(Math.pow((2.0 * z), 1.5));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (t <= 12500.0)
		tmp = Float64(t_1 * (Float64(2.0 * z) ^ 0.5));
	elseif (t <= 3.2e+222)
		tmp = sqrt(Float64(Float64(2.0 * z) * Float64(t_1 * t_1)));
	else
		tmp = Float64(t_1 * cbrt((Float64(2.0 * z) ^ 1.5)));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 12500.0], N[(t$95$1 * N[Power[N[(2.0 * z), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+222], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 3.2 \cdot 10^{+222}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(t\_1 \cdot t\_1\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 12500

    1. Initial program 98.6%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.7%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod67.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      2. pow1/267.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(z \cdot 2\right)}^{0.5}} \]
      3. *-commutative67.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(2 \cdot z\right)}}^{0.5} \]
    7. Applied egg-rr67.5%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}} \]

    if 12500 < t < 3.2000000000000001e222

    1. Initial program 98.0%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*100.0%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified100.0%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Step-by-step derivation
      1. pow117.6%

        \[\leadsto \color{blue}{{\left(x \cdot 0.5 - y\right)}^{1}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      2. metadata-eval17.6%

        \[\leadsto {\left(x \cdot 0.5 - y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      3. sqrt-pow125.2%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2}}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      4. *-rgt-identity25.2%

        \[\leadsto \sqrt{{\left(x \cdot 0.5 - y\right)}^{2}} \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      5. sqrt-prod34.7%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2} \cdot \left(z \cdot 2\right)}} \]
      6. *-commutative34.7%

        \[\leadsto \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      7. pow1/234.7%

        \[\leadsto \color{blue}{{\left(\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5}} \]
      8. *-commutative34.7%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5} \]
      9. associate-*l*34.7%

        \[\leadsto {\color{blue}{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}}^{0.5} \]
    7. Applied egg-rr34.7%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/234.7%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}} \]
      2. associate-*r*34.7%

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      3. *-commutative34.7%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{0.5 \cdot x} - y\right)}^{2}} \]
    9. Simplified34.7%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot z\right) \cdot {\left(0.5 \cdot x - y\right)}^{2}}} \]
    10. Step-by-step derivation
      1. *-commutative34.7%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{x \cdot 0.5} - y\right)}^{2}} \]
      2. pow234.7%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}} \]
    11. Applied egg-rr34.7%

      \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}} \]

    if 3.2000000000000001e222 < t

    1. Initial program 93.8%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*100.0%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified100.0%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod45.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      2. *-rgt-identity45.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot 1\right)} \]
      3. add-cbrt-cube45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt[3]{\left(\left(\sqrt{z \cdot 2} \cdot 1\right) \cdot \left(\sqrt{z \cdot 2} \cdot 1\right)\right) \cdot \left(\sqrt{z \cdot 2} \cdot 1\right)}} \]
      4. pow1/345.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(\left(\left(\sqrt{z \cdot 2} \cdot 1\right) \cdot \left(\sqrt{z \cdot 2} \cdot 1\right)\right) \cdot \left(\sqrt{z \cdot 2} \cdot 1\right)\right)}^{0.3333333333333333}} \]
      5. swap-sqr45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\color{blue}{\left(\left(\sqrt{z \cdot 2} \cdot \sqrt{z \cdot 2}\right) \cdot \left(1 \cdot 1\right)\right)} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right)\right)}^{0.3333333333333333} \]
      6. add-sqr-sqrt45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\left(\color{blue}{\left(z \cdot 2\right)} \cdot \left(1 \cdot 1\right)\right) \cdot \left(\sqrt{z \cdot 2} \cdot 1\right)\right)}^{0.3333333333333333} \]
      7. metadata-eval45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\left(\left(z \cdot 2\right) \cdot \color{blue}{1}\right) \cdot \left(\sqrt{z \cdot 2} \cdot 1\right)\right)}^{0.3333333333333333} \]
      8. *-rgt-identity45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\left(\left(z \cdot 2\right) \cdot 1\right) \cdot \color{blue}{\sqrt{z \cdot 2}}\right)}^{0.3333333333333333} \]
      9. associate-*r*45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(\left(z \cdot 2\right) \cdot \left(1 \cdot \sqrt{z \cdot 2}\right)\right)}}^{0.3333333333333333} \]
      10. pow145.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\color{blue}{{\left(z \cdot 2\right)}^{1}} \cdot \left(1 \cdot \sqrt{z \cdot 2}\right)\right)}^{0.3333333333333333} \]
      11. *-un-lft-identity45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left({\left(z \cdot 2\right)}^{1} \cdot \color{blue}{\sqrt{z \cdot 2}}\right)}^{0.3333333333333333} \]
      12. pow1/245.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left({\left(z \cdot 2\right)}^{1} \cdot \color{blue}{{\left(z \cdot 2\right)}^{0.5}}\right)}^{0.3333333333333333} \]
      13. pow-prod-up45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left({\left(z \cdot 2\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333} \]
      14. *-commutative45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left({\color{blue}{\left(2 \cdot z\right)}}^{\left(1 + 0.5\right)}\right)}^{0.3333333333333333} \]
      15. metadata-eval45.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left({\left(2 \cdot z\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} \]
    7. Applied egg-rr45.6%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left({\left(2 \cdot z\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    8. Step-by-step derivation
      1. unpow1/345.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}} \]
    9. Simplified45.6%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 12500:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot {\left(2 \cdot z\right)}^{0.5}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+222}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 59.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 8200:\\ \;\;\;\;t\_1 \cdot {\left(2 \cdot z\right)}^{0.5}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+236}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(t\_1 \cdot t\_1\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(x \cdot {\left({\left(2 \cdot z\right)}^{3}\right)}^{0.16666666666666666}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= t 8200.0)
     (* t_1 (pow (* 2.0 z) 0.5))
     (if (<= t 1.2e+236)
       (sqrt (* (* 2.0 z) (* t_1 t_1)))
       (* 0.5 (* x (pow (pow (* 2.0 z) 3.0) 0.16666666666666666)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 8200.0) {
		tmp = t_1 * pow((2.0 * z), 0.5);
	} else if (t <= 1.2e+236) {
		tmp = sqrt(((2.0 * z) * (t_1 * t_1)));
	} else {
		tmp = 0.5 * (x * pow(pow((2.0 * z), 3.0), 0.16666666666666666));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * 0.5d0) - y
    if (t <= 8200.0d0) then
        tmp = t_1 * ((2.0d0 * z) ** 0.5d0)
    else if (t <= 1.2d+236) then
        tmp = sqrt(((2.0d0 * z) * (t_1 * t_1)))
    else
        tmp = 0.5d0 * (x * (((2.0d0 * z) ** 3.0d0) ** 0.16666666666666666d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 8200.0) {
		tmp = t_1 * Math.pow((2.0 * z), 0.5);
	} else if (t <= 1.2e+236) {
		tmp = Math.sqrt(((2.0 * z) * (t_1 * t_1)));
	} else {
		tmp = 0.5 * (x * Math.pow(Math.pow((2.0 * z), 3.0), 0.16666666666666666));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * 0.5) - y
	tmp = 0
	if t <= 8200.0:
		tmp = t_1 * math.pow((2.0 * z), 0.5)
	elif t <= 1.2e+236:
		tmp = math.sqrt(((2.0 * z) * (t_1 * t_1)))
	else:
		tmp = 0.5 * (x * math.pow(math.pow((2.0 * z), 3.0), 0.16666666666666666))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (t <= 8200.0)
		tmp = Float64(t_1 * (Float64(2.0 * z) ^ 0.5));
	elseif (t <= 1.2e+236)
		tmp = sqrt(Float64(Float64(2.0 * z) * Float64(t_1 * t_1)));
	else
		tmp = Float64(0.5 * Float64(x * ((Float64(2.0 * z) ^ 3.0) ^ 0.16666666666666666)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * 0.5) - y;
	tmp = 0.0;
	if (t <= 8200.0)
		tmp = t_1 * ((2.0 * z) ^ 0.5);
	elseif (t <= 1.2e+236)
		tmp = sqrt(((2.0 * z) * (t_1 * t_1)));
	else
		tmp = 0.5 * (x * (((2.0 * z) ^ 3.0) ^ 0.16666666666666666));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 8200.0], N[(t$95$1 * N[Power[N[(2.0 * z), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+236], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.5 * N[(x * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 3.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 1.2 \cdot 10^{+236}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(t\_1 \cdot t\_1\right)}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot {\left({\left(2 \cdot z\right)}^{3}\right)}^{0.16666666666666666}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8200

    1. Initial program 98.6%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.7%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod67.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      2. pow1/267.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(z \cdot 2\right)}^{0.5}} \]
      3. *-commutative67.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(2 \cdot z\right)}}^{0.5} \]
    7. Applied egg-rr67.5%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}} \]

    if 8200 < t < 1.20000000000000006e236

    1. Initial program 98.0%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*100.0%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified100.0%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Step-by-step derivation
      1. pow119.3%

        \[\leadsto \color{blue}{{\left(x \cdot 0.5 - y\right)}^{1}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      2. metadata-eval19.3%

        \[\leadsto {\left(x \cdot 0.5 - y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      3. sqrt-pow126.7%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2}}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      4. *-rgt-identity26.7%

        \[\leadsto \sqrt{{\left(x \cdot 0.5 - y\right)}^{2}} \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      5. sqrt-prod36.0%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2} \cdot \left(z \cdot 2\right)}} \]
      6. *-commutative36.0%

        \[\leadsto \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      7. pow1/236.0%

        \[\leadsto \color{blue}{{\left(\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5}} \]
      8. *-commutative36.0%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5} \]
      9. associate-*l*36.0%

        \[\leadsto {\color{blue}{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}}^{0.5} \]
    7. Applied egg-rr36.0%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/236.0%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}} \]
      2. associate-*r*36.0%

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      3. *-commutative36.0%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{0.5 \cdot x} - y\right)}^{2}} \]
    9. Simplified36.0%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot z\right) \cdot {\left(0.5 \cdot x - y\right)}^{2}}} \]
    10. Step-by-step derivation
      1. *-commutative36.0%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{x \cdot 0.5} - y\right)}^{2}} \]
      2. pow236.0%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}} \]
    11. Applied egg-rr36.0%

      \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}} \]

    if 1.20000000000000006e236 < t

    1. Initial program 93.3%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*100.0%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified100.0%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Taylor expanded in x around inf 21.9%

      \[\leadsto \color{blue}{0.5 \cdot \left(\left(x \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. associate-*l*21.9%

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)} \]
    8. Simplified21.9%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)} \]
    9. Step-by-step derivation
      1. sqrt-prod21.9%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \]
      2. pow1/221.9%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}}\right) \]
      3. metadata-eval21.9%

        \[\leadsto 0.5 \cdot \left(x \cdot {\left(2 \cdot z\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}}\right) \]
      4. pow-pow21.7%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left({\left(2 \cdot z\right)}^{1.5}\right)}^{0.3333333333333333}}\right) \]
      5. sqr-pow21.7%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\left({\left({\left(2 \cdot z\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \cdot {\left({\left(2 \cdot z\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}\right)}\right) \]
      6. pow-prod-down21.5%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left({\left(2 \cdot z\right)}^{1.5} \cdot {\left(2 \cdot z\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}}\right) \]
      7. pow-prod-up21.5%

        \[\leadsto 0.5 \cdot \left(x \cdot {\color{blue}{\left({\left(2 \cdot z\right)}^{\left(1.5 + 1.5\right)}\right)}}^{\left(\frac{0.3333333333333333}{2}\right)}\right) \]
      8. metadata-eval21.5%

        \[\leadsto 0.5 \cdot \left(x \cdot {\left({\left(2 \cdot z\right)}^{\color{blue}{3}}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}\right) \]
      9. metadata-eval21.5%

        \[\leadsto 0.5 \cdot \left(x \cdot {\left({\left(2 \cdot z\right)}^{3}\right)}^{\color{blue}{0.16666666666666666}}\right) \]
    10. Applied egg-rr21.5%

      \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left({\left(2 \cdot z\right)}^{3}\right)}^{0.16666666666666666}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8200:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot {\left(2 \cdot z\right)}^{0.5}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+236}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(x \cdot {\left({\left(2 \cdot z\right)}^{3}\right)}^{0.16666666666666666}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.5% accurate, 1.0× speedup?

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

\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Derivation
  1. Initial program 98.2%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Add Preprocessing
  3. Final simplification98.2%

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

Alternative 5: 84.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + {t}^{2} \cdot z\right)} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (- (* x 0.5) y) (sqrt (* 2.0 (+ z (* (pow t 2.0) z))))))
double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * sqrt((2.0 * (z + (pow(t, 2.0) * z))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * 0.5d0) - y) * sqrt((2.0d0 * (z + ((t ** 2.0d0) * z))))
end function
public static double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * Math.sqrt((2.0 * (z + (Math.pow(t, 2.0) * z))));
}
def code(x, y, z, t):
	return ((x * 0.5) - y) * math.sqrt((2.0 * (z + (math.pow(t, 2.0) * z))))
function code(x, y, z, t)
	return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * Float64(z + Float64((t ^ 2.0) * z)))))
end
function tmp = code(x, y, z, t)
	tmp = ((x * 0.5) - y) * sqrt((2.0 * (z + ((t ^ 2.0) * z))));
end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(z + N[(N[Power[t, 2.0], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + {t}^{2} \cdot z\right)}
\end{array}
Derivation
  1. Initial program 98.2%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    2. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
    3. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    4. exp-sqrt99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    5. exp-prod99.8%

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

    \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. pow199.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)}^{1}} \]
    2. sqrt-unprod99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}\right)}}^{1} \]
    3. associate-*l*99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{\color{blue}{z \cdot \left(2 \cdot {\left(e^{t}\right)}^{t}\right)}}\right)}^{1} \]
    4. pow-exp99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \cdot \color{blue}{e^{t \cdot t}}\right)}\right)}^{1} \]
    5. pow299.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \cdot e^{\color{blue}{{t}^{2}}}\right)}\right)}^{1} \]
  6. Applied egg-rr99.8%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(\sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}\right)}^{1}} \]
  7. Step-by-step derivation
    1. unpow199.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}} \]
    2. *-commutative99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(2 \cdot e^{{t}^{2}}\right) \cdot z}} \]
    3. *-commutative99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(e^{{t}^{2}} \cdot 2\right)} \cdot z} \]
    4. associate-*l*99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}} \]
  8. Simplified99.8%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}} \]
  9. Taylor expanded in t around 0 85.2%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{2 \cdot z + 2 \cdot \left({t}^{2} \cdot z\right)}} \]
  10. Step-by-step derivation
    1. distribute-lft-out85.2%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{2 \cdot \left(z + {t}^{2} \cdot z\right)}} \]
    2. *-commutative85.2%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + \color{blue}{z \cdot {t}^{2}}\right)} \]
  11. Simplified85.2%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{2 \cdot \left(z + z \cdot {t}^{2}\right)}} \]
  12. Final simplification85.2%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + {t}^{2} \cdot z\right)} \]
  13. Add Preprocessing

Alternative 6: 59.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 420000000:\\ \;\;\;\;t\_1 \cdot {\left(2 \cdot z\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(t\_1 \cdot t\_1\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= t 420000000.0)
     (* t_1 (pow (* 2.0 z) 0.5))
     (sqrt (* (* 2.0 z) (* t_1 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 420000000.0) {
		tmp = t_1 * pow((2.0 * z), 0.5);
	} else {
		tmp = sqrt(((2.0 * z) * (t_1 * t_1)));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * 0.5d0) - y
    if (t <= 420000000.0d0) then
        tmp = t_1 * ((2.0d0 * z) ** 0.5d0)
    else
        tmp = sqrt(((2.0d0 * z) * (t_1 * t_1)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 420000000.0) {
		tmp = t_1 * Math.pow((2.0 * z), 0.5);
	} else {
		tmp = Math.sqrt(((2.0 * z) * (t_1 * t_1)));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * 0.5) - y
	tmp = 0
	if t <= 420000000.0:
		tmp = t_1 * math.pow((2.0 * z), 0.5)
	else:
		tmp = math.sqrt(((2.0 * z) * (t_1 * t_1)))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (t <= 420000000.0)
		tmp = Float64(t_1 * (Float64(2.0 * z) ^ 0.5));
	else
		tmp = sqrt(Float64(Float64(2.0 * z) * Float64(t_1 * t_1)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * 0.5) - y;
	tmp = 0.0;
	if (t <= 420000000.0)
		tmp = t_1 * ((2.0 * z) ^ 0.5);
	else
		tmp = sqrt(((2.0 * z) * (t_1 * t_1)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 420000000.0], N[(t$95$1 * N[Power[N[(2.0 * z), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(t\_1 \cdot t\_1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.2e8

    1. Initial program 98.6%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.7%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod67.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      2. pow1/267.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(z \cdot 2\right)}^{0.5}} \]
      3. *-commutative67.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(2 \cdot z\right)}}^{0.5} \]
    7. Applied egg-rr67.5%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}} \]

    if 4.2e8 < t

    1. Initial program 97.0%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*100.0%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod100.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified100.0%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Step-by-step derivation
      1. pow124.4%

        \[\leadsto \color{blue}{{\left(x \cdot 0.5 - y\right)}^{1}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      2. metadata-eval24.4%

        \[\leadsto {\left(x \cdot 0.5 - y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      3. sqrt-pow123.8%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2}}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      4. *-rgt-identity23.8%

        \[\leadsto \sqrt{{\left(x \cdot 0.5 - y\right)}^{2}} \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      5. sqrt-prod31.0%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2} \cdot \left(z \cdot 2\right)}} \]
      6. *-commutative31.0%

        \[\leadsto \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      7. pow1/231.0%

        \[\leadsto \color{blue}{{\left(\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5}} \]
      8. *-commutative31.0%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5} \]
      9. associate-*l*31.0%

        \[\leadsto {\color{blue}{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}}^{0.5} \]
    7. Applied egg-rr31.0%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/231.0%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}} \]
      2. associate-*r*31.0%

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      3. *-commutative31.0%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{0.5 \cdot x} - y\right)}^{2}} \]
    9. Simplified31.0%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot z\right) \cdot {\left(0.5 \cdot x - y\right)}^{2}}} \]
    10. Step-by-step derivation
      1. *-commutative31.0%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{x \cdot 0.5} - y\right)}^{2}} \]
      2. pow231.0%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}} \]
    11. Applied egg-rr31.0%

      \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.1%

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

Alternative 7: 43.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{2 \cdot z}\\ \mathbf{if}\;x \leq -1.25 \cdot 10^{+35} \lor \neg \left(x \leq 1.1 \cdot 10^{+15}\right):\\ \;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(-y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* 2.0 z))))
   (if (or (<= x -1.25e+35) (not (<= x 1.1e+15)))
     (* 0.5 (* x t_1))
     (* t_1 (- y)))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((2.0 * z));
	double tmp;
	if ((x <= -1.25e+35) || !(x <= 1.1e+15)) {
		tmp = 0.5 * (x * t_1);
	} else {
		tmp = t_1 * -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) :: t_1
    real(8) :: tmp
    t_1 = sqrt((2.0d0 * z))
    if ((x <= (-1.25d+35)) .or. (.not. (x <= 1.1d+15))) then
        tmp = 0.5d0 * (x * t_1)
    else
        tmp = t_1 * -y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((2.0 * z));
	double tmp;
	if ((x <= -1.25e+35) || !(x <= 1.1e+15)) {
		tmp = 0.5 * (x * t_1);
	} else {
		tmp = t_1 * -y;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.sqrt((2.0 * z))
	tmp = 0
	if (x <= -1.25e+35) or not (x <= 1.1e+15):
		tmp = 0.5 * (x * t_1)
	else:
		tmp = t_1 * -y
	return tmp
function code(x, y, z, t)
	t_1 = sqrt(Float64(2.0 * z))
	tmp = 0.0
	if ((x <= -1.25e+35) || !(x <= 1.1e+15))
		tmp = Float64(0.5 * Float64(x * t_1));
	else
		tmp = Float64(t_1 * Float64(-y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((2.0 * z));
	tmp = 0.0;
	if ((x <= -1.25e+35) || ~((x <= 1.1e+15)))
		tmp = 0.5 * (x * t_1);
	else
		tmp = t_1 * -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -1.25e+35], N[Not[LessEqual[x, 1.1e+15]], $MachinePrecision]], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * (-y)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+35} \lor \neg \left(x \leq 1.1 \cdot 10^{+15}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25000000000000005e35 or 1.1e15 < x

    1. Initial program 99.9%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified99.9%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Taylor expanded in x around inf 47.8%

      \[\leadsto \color{blue}{0.5 \cdot \left(\left(x \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. associate-*l*47.8%

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)} \]
    8. Simplified47.8%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)} \]
    9. Step-by-step derivation
      1. sqrt-prod47.9%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \]
      2. pow1/247.9%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}}\right) \]
    10. Applied egg-rr47.9%

      \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}}\right) \]
    11. Step-by-step derivation
      1. unpow1/247.9%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \]
      2. *-commutative47.9%

        \[\leadsto 0.5 \cdot \left(x \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \]
    12. Simplified47.9%

      \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt{z \cdot 2}}\right) \]

    if -1.25000000000000005e35 < x < 1.1e15

    1. Initial program 96.8%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.7%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Taylor expanded in x around 0 41.6%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg41.6%

        \[\leadsto \color{blue}{-\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}} \]
      2. associate-*l*41.6%

        \[\leadsto -\color{blue}{y \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)} \]
      3. *-commutative41.6%

        \[\leadsto -y \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
      4. distribute-rgt-neg-in41.6%

        \[\leadsto \color{blue}{y \cdot \left(-\sqrt{z} \cdot \sqrt{2}\right)} \]
      5. distribute-rgt-neg-in41.6%

        \[\leadsto y \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
    8. Simplified41.6%

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
    9. Applied egg-rr41.6%

      \[\leadsto \color{blue}{-\sqrt{z \cdot 2} \cdot y} \]
    10. Step-by-step derivation
      1. distribute-rgt-neg-in41.6%

        \[\leadsto \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
    11. Simplified41.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+35} \lor \neg \left(x \leq 1.1 \cdot 10^{+15}\right):\\ \;\;\;\;0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot z} \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 44.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{2 \cdot z}\\ \mathbf{if}\;y \leq -0.063:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\ \mathbf{elif}\;y \leq 33000000000000:\\ \;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(-y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* 2.0 z))))
   (if (<= y -0.063)
     (sqrt (* (* 2.0 z) (* y (- y x))))
     (if (<= y 33000000000000.0) (* 0.5 (* x t_1)) (* t_1 (- y))))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((2.0 * z));
	double tmp;
	if (y <= -0.063) {
		tmp = sqrt(((2.0 * z) * (y * (y - x))));
	} else if (y <= 33000000000000.0) {
		tmp = 0.5 * (x * t_1);
	} else {
		tmp = t_1 * -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) :: t_1
    real(8) :: tmp
    t_1 = sqrt((2.0d0 * z))
    if (y <= (-0.063d0)) then
        tmp = sqrt(((2.0d0 * z) * (y * (y - x))))
    else if (y <= 33000000000000.0d0) then
        tmp = 0.5d0 * (x * t_1)
    else
        tmp = t_1 * -y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((2.0 * z));
	double tmp;
	if (y <= -0.063) {
		tmp = Math.sqrt(((2.0 * z) * (y * (y - x))));
	} else if (y <= 33000000000000.0) {
		tmp = 0.5 * (x * t_1);
	} else {
		tmp = t_1 * -y;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.sqrt((2.0 * z))
	tmp = 0
	if y <= -0.063:
		tmp = math.sqrt(((2.0 * z) * (y * (y - x))))
	elif y <= 33000000000000.0:
		tmp = 0.5 * (x * t_1)
	else:
		tmp = t_1 * -y
	return tmp
function code(x, y, z, t)
	t_1 = sqrt(Float64(2.0 * z))
	tmp = 0.0
	if (y <= -0.063)
		tmp = sqrt(Float64(Float64(2.0 * z) * Float64(y * Float64(y - x))));
	elseif (y <= 33000000000000.0)
		tmp = Float64(0.5 * Float64(x * t_1));
	else
		tmp = Float64(t_1 * Float64(-y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((2.0 * z));
	tmp = 0.0;
	if (y <= -0.063)
		tmp = sqrt(((2.0 * z) * (y * (y - x))));
	elseif (y <= 33000000000000.0)
		tmp = 0.5 * (x * t_1);
	else
		tmp = t_1 * -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -0.063], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 33000000000000.0], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * (-y)), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;y \leq -0.063:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\

\mathbf{elif}\;y \leq 33000000000000:\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.063

    1. Initial program 99.9%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified99.9%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Step-by-step derivation
      1. pow156.2%

        \[\leadsto \color{blue}{{\left(x \cdot 0.5 - y\right)}^{1}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      2. metadata-eval56.2%

        \[\leadsto {\left(x \cdot 0.5 - y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      3. sqrt-pow161.9%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2}}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      4. *-rgt-identity61.9%

        \[\leadsto \sqrt{{\left(x \cdot 0.5 - y\right)}^{2}} \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      5. sqrt-prod69.5%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2} \cdot \left(z \cdot 2\right)}} \]
      6. *-commutative69.5%

        \[\leadsto \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      7. pow1/269.5%

        \[\leadsto \color{blue}{{\left(\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5}} \]
      8. *-commutative69.5%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5} \]
      9. associate-*l*69.5%

        \[\leadsto {\color{blue}{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}}^{0.5} \]
    7. Applied egg-rr69.5%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/269.5%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}} \]
      2. associate-*r*69.5%

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      3. *-commutative69.5%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{0.5 \cdot x} - y\right)}^{2}} \]
    9. Simplified69.5%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot z\right) \cdot {\left(0.5 \cdot x - y\right)}^{2}}} \]
    10. Taylor expanded in x around 0 63.3%

      \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(-1 \cdot \left(x \cdot y\right) + {y}^{2}\right)}} \]
    11. Step-by-step derivation
      1. +-commutative63.3%

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

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \left({y}^{2} + \color{blue}{\left(-x \cdot y\right)}\right)} \]
      3. unsub-neg63.3%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left({y}^{2} - x \cdot y\right)}} \]
      4. unpow263.3%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \left(\color{blue}{y \cdot y} - x \cdot y\right)} \]
      5. distribute-rgt-out--65.0%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(y \cdot \left(y - x\right)\right)}} \]
    12. Simplified65.0%

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

    if -0.063 < y < 3.3e13

    1. Initial program 96.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.7%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Taylor expanded in x around inf 41.4%

      \[\leadsto \color{blue}{0.5 \cdot \left(\left(x \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. associate-*l*41.4%

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)} \]
    8. Simplified41.4%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)} \]
    9. Step-by-step derivation
      1. sqrt-prod41.5%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \]
      2. pow1/241.5%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}}\right) \]
    10. Applied egg-rr41.5%

      \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}}\right) \]
    11. Step-by-step derivation
      1. unpow1/241.5%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \]
      2. *-commutative41.5%

        \[\leadsto 0.5 \cdot \left(x \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \]
    12. Simplified41.5%

      \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt{z \cdot 2}}\right) \]

    if 3.3e13 < y

    1. Initial program 99.8%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.8%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Taylor expanded in x around 0 48.1%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg48.1%

        \[\leadsto \color{blue}{-\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}} \]
      2. associate-*l*48.1%

        \[\leadsto -\color{blue}{y \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)} \]
      3. *-commutative48.1%

        \[\leadsto -y \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
      4. distribute-rgt-neg-in48.1%

        \[\leadsto \color{blue}{y \cdot \left(-\sqrt{z} \cdot \sqrt{2}\right)} \]
      5. distribute-rgt-neg-in48.1%

        \[\leadsto y \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
    8. Simplified48.1%

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
    9. Applied egg-rr48.1%

      \[\leadsto \color{blue}{-\sqrt{z \cdot 2} \cdot y} \]
    10. Step-by-step derivation
      1. distribute-rgt-neg-in48.1%

        \[\leadsto \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
    11. Simplified48.1%

      \[\leadsto \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.063:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\ \mathbf{elif}\;y \leq 33000000000000:\\ \;\;\;\;0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot z} \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 55.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+101}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot {\left(2 \cdot z\right)}^{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.49999999999999994e101

    1. Initial program 99.9%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified99.9%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Step-by-step derivation
      1. pow152.7%

        \[\leadsto \color{blue}{{\left(x \cdot 0.5 - y\right)}^{1}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      2. metadata-eval52.7%

        \[\leadsto {\left(x \cdot 0.5 - y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      3. sqrt-pow166.4%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2}}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      4. *-rgt-identity66.4%

        \[\leadsto \sqrt{{\left(x \cdot 0.5 - y\right)}^{2}} \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      5. sqrt-prod75.9%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2} \cdot \left(z \cdot 2\right)}} \]
      6. *-commutative75.9%

        \[\leadsto \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      7. pow1/275.9%

        \[\leadsto \color{blue}{{\left(\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5}} \]
      8. *-commutative75.9%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5} \]
      9. associate-*l*75.9%

        \[\leadsto {\color{blue}{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}}^{0.5} \]
    7. Applied egg-rr75.9%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/275.9%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}} \]
      2. associate-*r*75.9%

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      3. *-commutative75.9%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{0.5 \cdot x} - y\right)}^{2}} \]
    9. Simplified75.9%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot z\right) \cdot {\left(0.5 \cdot x - y\right)}^{2}}} \]
    10. Taylor expanded in x around 0 73.3%

      \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(-1 \cdot \left(x \cdot y\right) + {y}^{2}\right)}} \]
    11. Step-by-step derivation
      1. +-commutative73.3%

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

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \left({y}^{2} + \color{blue}{\left(-x \cdot y\right)}\right)} \]
      3. unsub-neg73.3%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left({y}^{2} - x \cdot y\right)}} \]
      4. unpow273.3%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \left(\color{blue}{y \cdot y} - x \cdot y\right)} \]
      5. distribute-rgt-out--75.9%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(y \cdot \left(y - x\right)\right)}} \]
    12. Simplified75.9%

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

    if -2.49999999999999994e101 < y

    1. Initial program 97.9%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.7%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod57.0%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      2. pow1/257.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(z \cdot 2\right)}^{0.5}} \]
      3. *-commutative57.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(2 \cdot z\right)}}^{0.5} \]
    7. Applied egg-rr57.1%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.0%

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

Alternative 10: 55.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+100}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.80000000000000023e100

    1. Initial program 99.9%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \]
    3. Simplified99.9%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Step-by-step derivation
      1. pow152.7%

        \[\leadsto \color{blue}{{\left(x \cdot 0.5 - y\right)}^{1}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      2. metadata-eval52.7%

        \[\leadsto {\left(x \cdot 0.5 - y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      3. sqrt-pow166.4%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2}}} \cdot \left(\sqrt{z \cdot 2} \cdot 1\right) \]
      4. *-rgt-identity66.4%

        \[\leadsto \sqrt{{\left(x \cdot 0.5 - y\right)}^{2}} \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      5. sqrt-prod75.9%

        \[\leadsto \color{blue}{\sqrt{{\left(x \cdot 0.5 - y\right)}^{2} \cdot \left(z \cdot 2\right)}} \]
      6. *-commutative75.9%

        \[\leadsto \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      7. pow1/275.9%

        \[\leadsto \color{blue}{{\left(\left(z \cdot 2\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5}} \]
      8. *-commutative75.9%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}^{0.5} \]
      9. associate-*l*75.9%

        \[\leadsto {\color{blue}{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}}^{0.5} \]
    7. Applied egg-rr75.9%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/275.9%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(z \cdot {\left(x \cdot 0.5 - y\right)}^{2}\right)}} \]
      2. associate-*r*75.9%

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}} \]
      3. *-commutative75.9%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot {\left(\color{blue}{0.5 \cdot x} - y\right)}^{2}} \]
    9. Simplified75.9%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot z\right) \cdot {\left(0.5 \cdot x - y\right)}^{2}}} \]
    10. Taylor expanded in x around 0 73.3%

      \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(-1 \cdot \left(x \cdot y\right) + {y}^{2}\right)}} \]
    11. Step-by-step derivation
      1. +-commutative73.3%

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

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \left({y}^{2} + \color{blue}{\left(-x \cdot y\right)}\right)} \]
      3. unsub-neg73.3%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left({y}^{2} - x \cdot y\right)}} \]
      4. unpow273.3%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \left(\color{blue}{y \cdot y} - x \cdot y\right)} \]
      5. distribute-rgt-out--75.9%

        \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(y \cdot \left(y - x\right)\right)}} \]
    12. Simplified75.9%

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

    if -4.80000000000000023e100 < y

    1. Initial program 97.9%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

        \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      2. remove-double-neg99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
      3. remove-double-neg99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
      4. exp-sqrt99.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      5. exp-prod99.7%

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

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. pow199.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)}^{1}} \]
      2. sqrt-unprod99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}\right)}}^{1} \]
      3. associate-*l*99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{\color{blue}{z \cdot \left(2 \cdot {\left(e^{t}\right)}^{t}\right)}}\right)}^{1} \]
      4. pow-exp99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \cdot \color{blue}{e^{t \cdot t}}\right)}\right)}^{1} \]
      5. pow299.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \cdot e^{\color{blue}{{t}^{2}}}\right)}\right)}^{1} \]
    6. Applied egg-rr99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(\sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}\right)}^{1}} \]
    7. Step-by-step derivation
      1. unpow199.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}} \]
      2. *-commutative99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(2 \cdot e^{{t}^{2}}\right) \cdot z}} \]
      3. *-commutative99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(e^{{t}^{2}} \cdot 2\right)} \cdot z} \]
      4. associate-*l*99.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}} \]
    8. Simplified99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}} \]
    9. Taylor expanded in t around 0 57.0%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{2 \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.0%

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

Alternative 11: 29.6% accurate, 2.0× speedup?

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

\\
\sqrt{2 \cdot z} \cdot \left(-y\right)
\end{array}
Derivation
  1. Initial program 98.2%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    2. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
    3. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    4. exp-sqrt99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    5. exp-prod99.8%

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

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

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
  6. Taylor expanded in x around 0 27.9%

    \[\leadsto \color{blue}{-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \]
  7. Step-by-step derivation
    1. mul-1-neg27.9%

      \[\leadsto \color{blue}{-\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}} \]
    2. associate-*l*27.9%

      \[\leadsto -\color{blue}{y \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)} \]
    3. *-commutative27.9%

      \[\leadsto -y \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
    4. distribute-rgt-neg-in27.9%

      \[\leadsto \color{blue}{y \cdot \left(-\sqrt{z} \cdot \sqrt{2}\right)} \]
    5. distribute-rgt-neg-in27.9%

      \[\leadsto y \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
  8. Simplified27.9%

    \[\leadsto \color{blue}{y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
  9. Applied egg-rr28.0%

    \[\leadsto \color{blue}{-\sqrt{z \cdot 2} \cdot y} \]
  10. Step-by-step derivation
    1. distribute-rgt-neg-in28.0%

      \[\leadsto \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
  11. Simplified28.0%

    \[\leadsto \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
  12. Final simplification28.0%

    \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
  13. Add Preprocessing

Alternative 12: 2.3% accurate, 2.0× speedup?

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

\\
y \cdot \sqrt{2 \cdot z}
\end{array}
Derivation
  1. Initial program 98.2%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    2. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(-\left(-\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)\right)} \]
    3. remove-double-neg99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    4. exp-sqrt99.8%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    5. exp-prod99.8%

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

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

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
  6. Taylor expanded in x around 0 27.9%

    \[\leadsto \color{blue}{-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \]
  7. Step-by-step derivation
    1. mul-1-neg27.9%

      \[\leadsto \color{blue}{-\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}} \]
    2. associate-*l*27.9%

      \[\leadsto -\color{blue}{y \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)} \]
    3. *-commutative27.9%

      \[\leadsto -y \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)} \]
    4. distribute-rgt-neg-in27.9%

      \[\leadsto \color{blue}{y \cdot \left(-\sqrt{z} \cdot \sqrt{2}\right)} \]
    5. distribute-rgt-neg-in27.9%

      \[\leadsto y \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
  8. Simplified27.9%

    \[\leadsto \color{blue}{y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)} \]
  9. Applied egg-rr2.2%

    \[\leadsto y \cdot \color{blue}{{\left(\sqrt{z \cdot 2}\right)}^{1}} \]
  10. Step-by-step derivation
    1. unpow12.2%

      \[\leadsto y \cdot \color{blue}{\sqrt{z \cdot 2}} \]
  11. Simplified2.2%

    \[\leadsto y \cdot \color{blue}{\sqrt{z \cdot 2}} \]
  12. Final simplification2.2%

    \[\leadsto y \cdot \sqrt{2 \cdot z} \]
  13. Add Preprocessing

Developer target: 99.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
	return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp(1.0), ((t * 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 * 0.5d0) - y) * sqrt((z * 2.0d0))) * (exp(1.0d0) ** ((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
	return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.exp(1.0), ((t * t) / 2.0));
}
def code(x, y, z, t):
	return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp(1.0), ((t * t) / 2.0))
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(1.0) ^ Float64(Float64(t * t) / 2.0)))
end
function tmp = code(x, y, z, t)
	tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp(1.0) ^ ((t * t) / 2.0));
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[1.0], $MachinePrecision], N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)}
\end{array}

Reproduce

?
herbie shell --seed 2024115 
(FPCore (x y z t)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
  :precision binary64

  :alt
  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))

  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))