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

Percentage Accurate: 99.4% → 99.8%
Time: 14.1s
Alternatives: 15
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 15 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.4% 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}^{\left(t \cdot t\right)} \cdot \left(2 \cdot z\right)} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (- (* x 0.5) y) (sqrt (* (pow E (* t t)) (* 2.0 z)))))
double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * sqrt((pow(((double) M_E), (t * t)) * (2.0 * z)));
}
public static double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * Math.sqrt((Math.pow(Math.E, (t * t)) * (2.0 * z)));
}
def code(x, y, z, t):
	return ((x * 0.5) - y) * math.sqrt((math.pow(math.e, (t * t)) * (2.0 * z)))
function code(x, y, z, t)
	return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64((exp(1) ^ Float64(t * t)) * Float64(2.0 * z))))
end
function tmp = code(x, y, z, t)
	tmp = ((x * 0.5) - y) * sqrt(((2.71828182845904523536 ^ (t * t)) * (2.0 * z)));
end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[Power[E, N[(t * t), $MachinePrecision]], $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\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. 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) \]
  3. Simplified99.8%

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right)} - 1\right) \]
    4. sqrt-unprod74.9%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}}\right)} - 1\right) \]
  5. Applied egg-rr74.9%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

    \[\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. 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) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{e^{t \cdot t}}\right)} \]
  4. Step-by-step derivation
    1. pow-exp99.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) \]
    2. sqrt-unprod99.8%

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

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

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

Alternative 3: 92.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\ t_2 := \sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}\\ t_3 := \frac{t_2}{\frac{-1}{y}}\\ \mathbf{if}\;t \cdot t \leq 50:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+109}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+159}:\\ \;\;\;\;\frac{t_2}{\frac{2}{x}}\\ \mathbf{elif}\;t \cdot t \leq 10^{+277}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (+ 1.0 (* 0.5 (* t t)))))
        (t_2 (sqrt (* (* 2.0 z) (exp (* t t)))))
        (t_3 (/ t_2 (/ -1.0 y))))
   (if (<= (* t t) 50.0)
     t_1
     (if (<= (* t t) 4e+109)
       t_3
       (if (<= (* t t) 5e+159)
         (/ t_2 (/ 2.0 x))
         (if (<= (* t t) 1e+277) t_3 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
	double t_2 = sqrt(((2.0 * z) * exp((t * t))));
	double t_3 = t_2 / (-1.0 / y);
	double tmp;
	if ((t * t) <= 50.0) {
		tmp = t_1;
	} else if ((t * t) <= 4e+109) {
		tmp = t_3;
	} else if ((t * t) <= 5e+159) {
		tmp = t_2 / (2.0 / x);
	} else if ((t * t) <= 1e+277) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (((x * 0.5d0) - y) * sqrt((2.0d0 * z))) * (1.0d0 + (0.5d0 * (t * t)))
    t_2 = sqrt(((2.0d0 * z) * exp((t * t))))
    t_3 = t_2 / ((-1.0d0) / y)
    if ((t * t) <= 50.0d0) then
        tmp = t_1
    else if ((t * t) <= 4d+109) then
        tmp = t_3
    else if ((t * t) <= 5d+159) then
        tmp = t_2 / (2.0d0 / x)
    else if ((t * t) <= 1d+277) then
        tmp = t_3
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (((x * 0.5) - y) * Math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
	double t_2 = Math.sqrt(((2.0 * z) * Math.exp((t * t))));
	double t_3 = t_2 / (-1.0 / y);
	double tmp;
	if ((t * t) <= 50.0) {
		tmp = t_1;
	} else if ((t * t) <= 4e+109) {
		tmp = t_3;
	} else if ((t * t) <= 5e+159) {
		tmp = t_2 / (2.0 / x);
	} else if ((t * t) <= 1e+277) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (((x * 0.5) - y) * math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)))
	t_2 = math.sqrt(((2.0 * z) * math.exp((t * t))))
	t_3 = t_2 / (-1.0 / y)
	tmp = 0
	if (t * t) <= 50.0:
		tmp = t_1
	elif (t * t) <= 4e+109:
		tmp = t_3
	elif (t * t) <= 5e+159:
		tmp = t_2 / (2.0 / x)
	elif (t * t) <= 1e+277:
		tmp = t_3
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) * Float64(1.0 + Float64(0.5 * Float64(t * t))))
	t_2 = sqrt(Float64(Float64(2.0 * z) * exp(Float64(t * t))))
	t_3 = Float64(t_2 / Float64(-1.0 / y))
	tmp = 0.0
	if (Float64(t * t) <= 50.0)
		tmp = t_1;
	elseif (Float64(t * t) <= 4e+109)
		tmp = t_3;
	elseif (Float64(t * t) <= 5e+159)
		tmp = Float64(t_2 / Float64(2.0 / x));
	elseif (Float64(t * t) <= 1e+277)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
	t_2 = sqrt(((2.0 * z) * exp((t * t))));
	t_3 = t_2 / (-1.0 / y);
	tmp = 0.0;
	if ((t * t) <= 50.0)
		tmp = t_1;
	elseif ((t * t) <= 4e+109)
		tmp = t_3;
	elseif ((t * t) <= 5e+159)
		tmp = t_2 / (2.0 / x);
	elseif ((t * t) <= 1e+277)
		tmp = t_3;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(-1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 50.0], t$95$1, If[LessEqual[N[(t * t), $MachinePrecision], 4e+109], t$95$3, If[LessEqual[N[(t * t), $MachinePrecision], 5e+159], N[(t$95$2 / N[(2.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+277], t$95$3, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\
t_2 := \sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}\\
t_3 := \frac{t_2}{\frac{-1}{y}}\\
\mathbf{if}\;t \cdot t \leq 50:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+109}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+159}:\\
\;\;\;\;\frac{t_2}{\frac{2}{x}}\\

\mathbf{elif}\;t \cdot t \leq 10^{+277}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 t t) < 50 or 1e277 < (*.f64 t t)

    1. Initial program 99.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 99.1%

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

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

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

    if 50 < (*.f64 t t) < 3.99999999999999993e109 or 5.00000000000000003e159 < (*.f64 t t) < 1e277

    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-*r*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. 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) \]
      3. *-commutative100.0%

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

        \[\leadsto \left(\sqrt{z \cdot 2} \cdot \sqrt{e^{t \cdot t}}\right) \cdot \color{blue}{\frac{\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) - y \cdot y}{x \cdot 0.5 + y}} \]
      5. associate-*r/93.8%

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

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

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

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

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{0.25} - y \cdot y\right)}{x \cdot 0.5 + y} \]
      10. fma-def93.8%

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\color{blue}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    3. Applied egg-rr93.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*93.8%

        \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
      2. *-commutative93.8%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(2 \cdot z\right)} \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
      3. exp-prod93.8%

        \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot \color{blue}{e^{t \cdot t}}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
    5. Simplified93.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
    6. Taylor expanded in x around 0 91.7%

      \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\color{blue}{\frac{-1}{y}}} \]

    if 3.99999999999999993e109 < (*.f64 t t) < 5.00000000000000003e159

    1. Initial program 100.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-*r*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. 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) \]
      3. *-commutative100.0%

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

        \[\leadsto \left(\sqrt{z \cdot 2} \cdot \sqrt{e^{t \cdot t}}\right) \cdot \color{blue}{\frac{\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) - y \cdot y}{x \cdot 0.5 + y}} \]
      5. associate-*r/81.8%

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

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

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

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

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{0.25} - y \cdot y\right)}{x \cdot 0.5 + y} \]
      10. fma-def81.8%

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\color{blue}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    3. Applied egg-rr81.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*81.8%

        \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
      2. *-commutative81.8%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(2 \cdot z\right)} \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
      3. exp-prod81.8%

        \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot \color{blue}{e^{t \cdot t}}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
    5. Simplified81.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
    6. Taylor expanded in x around inf 90.9%

      \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\color{blue}{\frac{2}{x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot t \leq 50:\\ \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\ \mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+109}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{-1}{y}}\\ \mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+159}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{2}{x}}\\ \mathbf{elif}\;t \cdot t \leq 10^{+277}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{-1}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\ \end{array} \]

Alternative 4: 92.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 50 \lor \neg \left(t \cdot t \leq 10^{+277}\right):\\
\;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{-1}{y}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 50 or 1e277 < (*.f64 t t)

    1. Initial program 99.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 99.1%

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

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

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

    if 50 < (*.f64 t t) < 1e277

    1. Initial program 98.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-*r*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. 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) \]
      3. *-commutative100.0%

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

        \[\leadsto \left(\sqrt{z \cdot 2} \cdot \sqrt{e^{t \cdot t}}\right) \cdot \color{blue}{\frac{\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) - y \cdot y}{x \cdot 0.5 + y}} \]
      5. associate-*r/91.5%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{z \cdot 2} \cdot \sqrt{e^{t \cdot t}}\right) \cdot \left(\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) - y \cdot y\right)}{x \cdot 0.5 + y}} \]
      6. pow-exp91.5%

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

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

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

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{0.25} - y \cdot y\right)}{x \cdot 0.5 + y} \]
      10. fma-def91.5%

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\color{blue}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    3. Applied egg-rr91.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*91.5%

        \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
      2. *-commutative91.5%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(2 \cdot z\right)} \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
      3. exp-prod91.5%

        \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot \color{blue}{e^{t \cdot t}}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
    5. Simplified91.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
    6. Taylor expanded in x around 0 83.1%

      \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\color{blue}{\frac{-1}{y}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot t \leq 50 \lor \neg \left(t \cdot t \leq 10^{+277}\right):\\ \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{-1}{y}}\\ \end{array} \]

Alternative 5: 99.8% accurate, 1.0× speedup?

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

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

    \[\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. 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) \]
  3. Simplified99.8%

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{{\left(e^{t}\right)}^{t}}}\right)} - 1\right) \]
    4. sqrt-unprod74.9%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}}\right)} - 1\right) \]
  5. Applied egg-rr74.9%

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

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

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

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

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

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

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

Alternative 6: 74.6% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;t \cdot t \leq 1.7 \cdot 10^{+154}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot \left(1 + t \cdot t\right)}}{\frac{2}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 t t) < 4.2e16

    1. Initial program 99.6%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 96.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)\right)} \]
      2. expm1-udef37.1%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(\color{blue}{x \cdot 0.5} - y\right)\right)\right)} - 1 \]
      5. associate-*r*37.1%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{2 \cdot z}} \cdot \left(x \cdot 0.5 - y\right)\right)} - 1 \]
      7. *-commutative37.1%

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right)\right)} \]
      2. expm1-log1p96.3%

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

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

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

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

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

    if 4.2e16 < (*.f64 t t) < 1.69999999999999987e154

    1. Initial program 96.4%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 15.2%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
      4. add-sqr-sqrt40.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{{y}^{2} \cdot \left(z \cdot 2\right)}} \]
      3. unpow243.8%

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

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(2 \cdot z\right)}} \]
      5. rem-log-exp43.3%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \left(2 \cdot \color{blue}{\log \left(e^{z}\right)}\right)} \]
      6. log-pow43.3%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\log \left({\left(e^{z}\right)}^{2}\right)}} \]
      7. unpow243.3%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z} \cdot e^{z}\right)}} \]
      8. prod-exp43.3%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z + z}\right)}} \]
      9. rem-log-exp43.8%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(z + z\right)}} \]
    11. Simplified43.8%

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

    if 1.69999999999999987e154 < (*.f64 t t)

    1. Initial program 100.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-*r*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. 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) \]
      3. *-commutative100.0%

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

        \[\leadsto \left(\sqrt{z \cdot 2} \cdot \sqrt{e^{t \cdot t}}\right) \cdot \color{blue}{\frac{\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) - y \cdot y}{x \cdot 0.5 + y}} \]
      5. associate-*r/86.8%

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

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

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

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

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{0.25} - y \cdot y\right)}{x \cdot 0.5 + y} \]
      10. fma-def86.8%

        \[\leadsto \frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\color{blue}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    3. Applied egg-rr86.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(\left(x \cdot x\right) \cdot 0.25 - y \cdot y\right)}{\mathsf{fma}\left(x, 0.5, y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*86.8%

        \[\leadsto \color{blue}{\frac{\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
      2. *-commutative86.8%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(2 \cdot z\right)} \cdot {\left(e^{t}\right)}^{t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
      3. exp-prod86.8%

        \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot \color{blue}{e^{t \cdot t}}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}} \]
    5. Simplified86.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{\mathsf{fma}\left(x, 0.5, y\right)}{\left(x \cdot x\right) \cdot 0.25 - y \cdot y}}} \]
    6. Taylor expanded in x around inf 74.7%

      \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\color{blue}{\frac{2}{x}}} \]
    7. Taylor expanded in t around 0 61.1%

      \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\left(1 + {t}^{2}\right)}}}{\frac{2}{x}} \]
    8. Step-by-step derivation
      1. unpow261.1%

        \[\leadsto \frac{\sqrt{\left(2 \cdot z\right) \cdot \left(1 + \color{blue}{t \cdot t}\right)}}{\frac{2}{x}} \]
    9. Simplified61.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot t \leq 4.2 \cdot 10^{+16}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\ \mathbf{elif}\;t \cdot t \leq 1.7 \cdot 10^{+154}:\\ \;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot \left(1 + t \cdot t\right)}}{\frac{2}{x}}\\ \end{array} \]

Alternative 7: 85.2% accurate, 1.8× speedup?

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

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

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Taylor expanded in t around 0 84.6%

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

      \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(1 + 0.5 \cdot \color{blue}{\left(t \cdot t\right)}\right) \]
  4. Simplified84.6%

    \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + 0.5 \cdot \left(t \cdot t\right)\right)} \]
  5. Final simplification84.6%

    \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right) \]

Alternative 8: 84.1% accurate, 1.9× speedup?

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

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

    \[\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. 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) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{e^{t \cdot t}}\right)} \]
  4. Step-by-step derivation
    1. pow-exp99.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) \]
    2. sqrt-unprod99.8%

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

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

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

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

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

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z \cdot 2\right) \cdot \color{blue}{\left(t \cdot t + 1\right)}} \]
  9. Final simplification84.5%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(1 + t \cdot t\right)} \]

Alternative 9: 44.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{z + z}\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+82}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\

\mathbf{elif}\;y \leq 3.55 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \left(0.5 \cdot t_1\right)\\

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


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

    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. Taylor expanded in t around 0 65.0%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
      4. add-sqr-sqrt66.5%

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(\sqrt{z} \cdot \sqrt{z}\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}} \]
      10. add-sqr-sqrt64.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{{y}^{2} \cdot \left(z \cdot 2\right)}} \]
      3. unpow262.5%

        \[\leadsto \sqrt{\color{blue}{\left(y \cdot y\right)} \cdot \left(z \cdot 2\right)} \]
      4. *-commutative62.5%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(2 \cdot z\right)}} \]
      5. rem-log-exp42.5%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \left(2 \cdot \color{blue}{\log \left(e^{z}\right)}\right)} \]
      6. log-pow42.5%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\log \left({\left(e^{z}\right)}^{2}\right)}} \]
      7. unpow242.5%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z} \cdot e^{z}\right)}} \]
      8. prod-exp42.6%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z + z}\right)}} \]
      9. rem-log-exp62.5%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(z + z\right)}} \]
    11. Simplified62.5%

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

    if -1.22000000000000008e82 < y < 3.54999999999999992e30

    1. Initial program 99.1%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 58.4%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.5 \cdot \left(\left(\sqrt{2} \cdot x\right) \cdot \sqrt{z}\right)\right)\right)} \]
      2. expm1-udef19.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.5 \cdot \left(\left(\sqrt{2} \cdot x\right) \cdot \sqrt{z}\right)\right)} - 1} \]
      3. *-commutative19.9%

        \[\leadsto e^{\mathsf{log1p}\left(0.5 \cdot \left(\color{blue}{\left(x \cdot \sqrt{2}\right)} \cdot \sqrt{z}\right)\right)} - 1 \]
      4. associate-*l*19.9%

        \[\leadsto e^{\mathsf{log1p}\left(0.5 \cdot \color{blue}{\left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)}\right)} - 1 \]
      5. sqrt-prod19.9%

        \[\leadsto e^{\mathsf{log1p}\left(0.5 \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right)\right)} - 1 \]
    7. Applied egg-rr19.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def31.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\right)\right)} \]
      2. expm1-log1p47.5%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \sqrt{2 \cdot z}\right)} \]
      6. rem-log-exp29.2%

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

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

        \[\leadsto x \cdot \left(0.5 \cdot \sqrt{\log \color{blue}{\left(e^{z} \cdot e^{z}\right)}}\right) \]
      9. prod-exp29.2%

        \[\leadsto x \cdot \left(0.5 \cdot \sqrt{\log \color{blue}{\left(e^{z + z}\right)}}\right) \]
      10. rem-log-exp47.5%

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

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

    if 3.54999999999999992e30 < 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. Taylor expanded in t around 0 62.0%

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-y\right)\right)} \]
    8. Step-by-step derivation
      1. expm1-log1p-u2.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)\right)} \]
      2. expm1-udef1.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)} - 1} \]
      3. associate-*r*1.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{z}\right) \cdot \left(-y\right)}\right)} - 1 \]
      4. pow1/21.7%

        \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{{2}^{0.5}} \cdot \sqrt{z}\right) \cdot \left(-y\right)\right)} - 1 \]
      5. pow1/21.7%

        \[\leadsto e^{\mathsf{log1p}\left(\left({2}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot \left(-y\right)\right)} - 1 \]
      6. pow-prod-down1.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(2 \cdot z\right)}^{0.5}} \cdot \left(-y\right)\right)} - 1 \]
      7. count-21.7%

        \[\leadsto e^{\mathsf{log1p}\left({\color{blue}{\left(z + z\right)}}^{0.5} \cdot \left(-y\right)\right)} - 1 \]
      8. pow1/21.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{z + z}} \cdot \left(-y\right)\right)} - 1 \]
    9. Applied egg-rr1.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def2.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)\right)} \]
      2. expm1-log1p44.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.22 \cdot 10^{+82}:\\ \;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\ \mathbf{elif}\;y \leq 3.55 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \sqrt{z + z}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\ \end{array} \]

Alternative 10: 58.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 350000:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\

\mathbf{elif}\;t \leq 6 \cdot 10^{+60}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\

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


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

    1. Initial program 99.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 69.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)\right)} \]
      2. expm1-udef27.2%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(\color{blue}{x \cdot 0.5} - y\right)\right)\right)} - 1 \]
      5. associate-*r*27.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{2 \cdot z}} \cdot \left(x \cdot 0.5 - y\right)\right)} - 1 \]
      7. *-commutative27.2%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def43.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right)\right)} \]
      2. expm1-log1p69.3%

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

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

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

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

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

    if 3.5e5 < t < 5.9999999999999997e60

    1. Initial program 88.9%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 15.8%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
      4. add-sqr-sqrt67.3%

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(\sqrt{z} \cdot \sqrt{z}\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}} \]
      10. add-sqr-sqrt67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(2 \cdot z\right)}} \]
      5. rem-log-exp67.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \left(2 \cdot \color{blue}{\log \left(e^{z}\right)}\right)} \]
      6. log-pow67.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\log \left({\left(e^{z}\right)}^{2}\right)}} \]
      7. unpow267.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z} \cdot e^{z}\right)}} \]
      8. prod-exp67.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z + z}\right)}} \]
      9. rem-log-exp56.6%

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

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

    if 5.9999999999999997e60 < t

    1. Initial program 100.0%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 30.8%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
      4. add-sqr-sqrt28.7%

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(\sqrt{z} \cdot \sqrt{z}\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}} \]
      10. add-sqr-sqrt32.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(z \cdot 0.5\right)} \cdot {x}^{2}} \]
      3. unpow228.6%

        \[\leadsto \sqrt{\left(z \cdot 0.5\right) \cdot \color{blue}{\left(x \cdot x\right)}} \]
    11. Simplified28.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 350000:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+60}:\\ \;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(0.5 \cdot z\right) \cdot \left(x \cdot x\right)}\\ \end{array} \]

Alternative 11: 31.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 950:\\
\;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\

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


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

    1. Initial program 99.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 69.2%

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(-y \cdot \sqrt{z}\right)} \]
      2. distribute-lft-neg-out30.0%

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-y\right)\right)} \]
    8. Step-by-step derivation
      1. expm1-log1p-u19.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)\right)} \]
      2. expm1-udef12.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)} - 1} \]
      3. associate-*r*12.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{z}\right) \cdot \left(-y\right)}\right)} - 1 \]
      4. pow1/212.3%

        \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{{2}^{0.5}} \cdot \sqrt{z}\right) \cdot \left(-y\right)\right)} - 1 \]
      5. pow1/212.3%

        \[\leadsto e^{\mathsf{log1p}\left(\left({2}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot \left(-y\right)\right)} - 1 \]
      6. pow-prod-down12.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(2 \cdot z\right)}^{0.5}} \cdot \left(-y\right)\right)} - 1 \]
      7. count-212.3%

        \[\leadsto e^{\mathsf{log1p}\left({\color{blue}{\left(z + z\right)}}^{0.5} \cdot \left(-y\right)\right)} - 1 \]
      8. pow1/212.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{z + z}} \cdot \left(-y\right)\right)} - 1 \]
    9. Applied egg-rr12.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def19.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)\right)} \]
      2. expm1-log1p30.1%

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

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

    if 950 < t

    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. Taylor expanded in t around 0 28.4%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
      4. add-sqr-sqrt34.9%

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(\sqrt{z} \cdot \sqrt{z}\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}} \]
      10. add-sqr-sqrt38.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(2 \cdot z\right)}} \]
      5. rem-log-exp31.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \left(2 \cdot \color{blue}{\log \left(e^{z}\right)}\right)} \]
      6. log-pow31.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\log \left({\left(e^{z}\right)}^{2}\right)}} \]
      7. unpow231.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z} \cdot e^{z}\right)}} \]
      8. prod-exp31.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z + z}\right)}} \]
      9. rem-log-exp20.9%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(z + z\right)}} \]
    11. Simplified20.9%

      \[\leadsto \sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(z + z\right)}} \]
    12. Taylor expanded in y around 0 20.9%

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

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

        \[\leadsto \sqrt{\color{blue}{\left(y \cdot y\right) \cdot z + \left(y \cdot y\right) \cdot z}} \]
      3. distribute-lft-out20.9%

        \[\leadsto \sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(z + z\right)}} \]
      4. associate-*r*20.9%

        \[\leadsto \sqrt{\color{blue}{y \cdot \left(y \cdot \left(z + z\right)\right)}} \]
      5. distribute-lft-in20.9%

        \[\leadsto \sqrt{y \cdot \color{blue}{\left(y \cdot z + y \cdot z\right)}} \]
      6. count-220.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 950:\\ \;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot \left(2 \cdot \left(y \cdot z\right)\right)}\\ \end{array} \]

Alternative 12: 32.5% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 900:\\
\;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\


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

    1. Initial program 99.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 69.2%

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(-y \cdot \sqrt{z}\right)} \]
      2. distribute-lft-neg-out30.0%

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-y\right)\right)} \]
    8. Step-by-step derivation
      1. expm1-log1p-u19.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)\right)} \]
      2. expm1-udef12.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)} - 1} \]
      3. associate-*r*12.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{z}\right) \cdot \left(-y\right)}\right)} - 1 \]
      4. pow1/212.3%

        \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{{2}^{0.5}} \cdot \sqrt{z}\right) \cdot \left(-y\right)\right)} - 1 \]
      5. pow1/212.3%

        \[\leadsto e^{\mathsf{log1p}\left(\left({2}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot \left(-y\right)\right)} - 1 \]
      6. pow-prod-down12.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(2 \cdot z\right)}^{0.5}} \cdot \left(-y\right)\right)} - 1 \]
      7. count-212.3%

        \[\leadsto e^{\mathsf{log1p}\left({\color{blue}{\left(z + z\right)}}^{0.5} \cdot \left(-y\right)\right)} - 1 \]
      8. pow1/212.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{z + z}} \cdot \left(-y\right)\right)} - 1 \]
    9. Applied egg-rr12.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def19.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)\right)} \]
      2. expm1-log1p30.1%

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

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

    if 900 < t

    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. Taylor expanded in t around 0 28.4%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
      4. add-sqr-sqrt34.9%

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(\sqrt{z} \cdot \sqrt{z}\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}} \]
      10. add-sqr-sqrt38.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(2 \cdot z\right)}} \]
      5. rem-log-exp31.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \left(2 \cdot \color{blue}{\log \left(e^{z}\right)}\right)} \]
      6. log-pow31.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\log \left({\left(e^{z}\right)}^{2}\right)}} \]
      7. unpow231.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z} \cdot e^{z}\right)}} \]
      8. prod-exp31.0%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z + z}\right)}} \]
      9. rem-log-exp20.9%

        \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(z + z\right)}} \]
    11. Simplified20.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 900:\\ \;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\ \end{array} \]

Alternative 13: 38.3% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.39999999999999998e27

    1. Initial program 99.2%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in t around 0 56.9%

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(-y \cdot \sqrt{z}\right)} \]
      2. distribute-lft-neg-out30.0%

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-y\right)\right)} \]
    8. Step-by-step derivation
      1. expm1-log1p-u20.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)\right)} \]
      2. expm1-udef12.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)} - 1} \]
      3. associate-*r*12.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{z}\right) \cdot \left(-y\right)}\right)} - 1 \]
      4. pow1/212.8%

        \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{{2}^{0.5}} \cdot \sqrt{z}\right) \cdot \left(-y\right)\right)} - 1 \]
      5. pow1/212.8%

        \[\leadsto e^{\mathsf{log1p}\left(\left({2}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot \left(-y\right)\right)} - 1 \]
      6. pow-prod-down12.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(2 \cdot z\right)}^{0.5}} \cdot \left(-y\right)\right)} - 1 \]
      7. count-212.8%

        \[\leadsto e^{\mathsf{log1p}\left({\color{blue}{\left(z + z\right)}}^{0.5} \cdot \left(-y\right)\right)} - 1 \]
      8. pow1/212.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{z + z}} \cdot \left(-y\right)\right)} - 1 \]
    9. Applied egg-rr12.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def20.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)\right)} \]
      2. expm1-log1p30.1%

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

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

    if 2.39999999999999998e27 < 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. Taylor expanded in t around 0 68.7%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
      4. add-sqr-sqrt60.7%

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(\sqrt{z} \cdot \sqrt{z}\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}} \]
      10. add-sqr-sqrt60.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.4 \cdot 10^{+27}:\\ \;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(0.5 \cdot z\right) \cdot \left(x \cdot x\right)}\\ \end{array} \]

Alternative 14: 30.5% accurate, 2.0× speedup?

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

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

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Taylor expanded in t around 0 60.3%

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(-y \cdot \sqrt{z}\right)} \]
    2. distribute-lft-neg-out26.0%

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

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

    \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{z} \cdot \left(-y\right)\right)} \]
  8. Step-by-step derivation
    1. expm1-log1p-u16.8%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)\right)} \]
    2. expm1-udef11.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)} - 1} \]
    3. associate-*r*11.2%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{z}\right) \cdot \left(-y\right)}\right)} - 1 \]
    4. pow1/211.2%

      \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{{2}^{0.5}} \cdot \sqrt{z}\right) \cdot \left(-y\right)\right)} - 1 \]
    5. pow1/211.2%

      \[\leadsto e^{\mathsf{log1p}\left(\left({2}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot \left(-y\right)\right)} - 1 \]
    6. pow-prod-down11.2%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(2 \cdot z\right)}^{0.5}} \cdot \left(-y\right)\right)} - 1 \]
    7. count-211.2%

      \[\leadsto e^{\mathsf{log1p}\left({\color{blue}{\left(z + z\right)}}^{0.5} \cdot \left(-y\right)\right)} - 1 \]
    8. pow1/211.2%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{z + z}} \cdot \left(-y\right)\right)} - 1 \]
  9. Applied egg-rr11.2%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)} - 1} \]
  10. Step-by-step derivation
    1. expm1-def16.8%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z + z} \cdot \left(-y\right)\right)\right)} \]
    2. expm1-log1p26.1%

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

    \[\leadsto \color{blue}{\sqrt{z + z} \cdot \left(-y\right)} \]
  12. Final simplification26.1%

    \[\leadsto y \cdot \left(-\sqrt{z + z}\right) \]

Alternative 15: 2.6% accurate, 2.0× speedup?

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

\\
y \cdot \sqrt{z + z}
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Taylor expanded in t around 0 60.3%

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)\right)}} \]
    4. add-sqr-sqrt32.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{{y}^{2} \cdot \left(z \cdot 2\right)}} \]
    3. unpow217.8%

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

      \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(2 \cdot z\right)}} \]
    5. rem-log-exp16.1%

      \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \left(2 \cdot \color{blue}{\log \left(e^{z}\right)}\right)} \]
    6. log-pow16.1%

      \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\log \left({\left(e^{z}\right)}^{2}\right)}} \]
    7. unpow216.1%

      \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z} \cdot e^{z}\right)}} \]
    8. prod-exp16.2%

      \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \log \color{blue}{\left(e^{z + z}\right)}} \]
    9. rem-log-exp17.8%

      \[\leadsto \sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(z + z\right)}} \]
  11. Simplified17.8%

    \[\leadsto \sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(z + z\right)}} \]
  12. Step-by-step derivation
    1. pow1/217.8%

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

      \[\leadsto {\color{blue}{\left(\left(z + z\right) \cdot \left(y \cdot y\right)\right)}}^{0.5} \]
    3. unpow-prod-down16.8%

      \[\leadsto \color{blue}{{\left(z + z\right)}^{0.5} \cdot {\left(y \cdot y\right)}^{0.5}} \]
    4. pow1/216.8%

      \[\leadsto \color{blue}{\sqrt{z + z}} \cdot {\left(y \cdot y\right)}^{0.5} \]
    5. pow1/216.8%

      \[\leadsto \sqrt{z + z} \cdot \color{blue}{\sqrt{y \cdot y}} \]
  13. Applied egg-rr16.8%

    \[\leadsto \color{blue}{\sqrt{z + z} \cdot \sqrt{y \cdot y}} \]
  14. Step-by-step derivation
    1. *-commutative16.8%

      \[\leadsto \color{blue}{\sqrt{y \cdot y} \cdot \sqrt{z + z}} \]
    2. rem-sqrt-square15.7%

      \[\leadsto \color{blue}{\left|y\right|} \cdot \sqrt{z + z} \]
    3. unpow115.7%

      \[\leadsto \left|\color{blue}{{y}^{1}}\right| \cdot \sqrt{z + z} \]
    4. sqr-pow1.3%

      \[\leadsto \left|\color{blue}{{y}^{\left(\frac{1}{2}\right)} \cdot {y}^{\left(\frac{1}{2}\right)}}\right| \cdot \sqrt{z + z} \]
    5. fabs-sqr1.3%

      \[\leadsto \color{blue}{\left({y}^{\left(\frac{1}{2}\right)} \cdot {y}^{\left(\frac{1}{2}\right)}\right)} \cdot \sqrt{z + z} \]
    6. sqr-pow2.4%

      \[\leadsto \color{blue}{{y}^{1}} \cdot \sqrt{z + z} \]
    7. unpow12.4%

      \[\leadsto \color{blue}{y} \cdot \sqrt{z + z} \]
  15. Simplified2.4%

    \[\leadsto \color{blue}{y \cdot \sqrt{z + z}} \]
  16. Final simplification2.4%

    \[\leadsto y \cdot \sqrt{z + z} \]

Developer target: 99.4% 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 2023230 
(FPCore (x y z t)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
  :precision binary64

  :herbie-target
  (* (* (- (* 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))))