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

Percentage Accurate: 99.5% → 99.8%
Time: 14.1s
Alternatives: 11
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 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

      \[\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-udef78.3%

      \[\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. sqrt-unprod78.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (exp (* t t))))))
t = abs(t);
double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * sqrt(((2.0 * z) * exp((t * t))));
}
NOTE: t should be positive before calling this function
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
t = Math.abs(t);
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))));
}
t = abs(t)
def code(x, y, z, t):
	return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * math.exp((t * t))))
t = abs(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
t = abs(t)
function tmp = code(x, y, z, t)
	tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * exp((t * t))));
end
NOTE: t should be positive before calling this function
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}
t = |t|\\
\\
\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.3%

      \[\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-udef78.3%

      \[\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. sqrt-unprod78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.3% accurate, 1.8× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;2 \cdot z \leq 5 \cdot 10^{+80}:\\ \;\;\;\;\left(t_1 \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= (* 2.0 z) 5e+80)
     (* (* t_1 (sqrt (* 2.0 z))) (+ 1.0 (* 0.5 (* t t))))
     (* t_1 (sqrt (* (* 2.0 z) (+ (* t t) 1.0)))))))
t = abs(t);
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if ((2.0 * z) <= 5e+80) {
		tmp = (t_1 * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
	} else {
		tmp = t_1 * sqrt(((2.0 * z) * ((t * t) + 1.0)));
	}
	return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * 0.5d0) - y
    if ((2.0d0 * z) <= 5d+80) then
        tmp = (t_1 * sqrt((2.0d0 * z))) * (1.0d0 + (0.5d0 * (t * t)))
    else
        tmp = t_1 * sqrt(((2.0d0 * z) * ((t * t) + 1.0d0)))
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if ((2.0 * z) <= 5e+80) {
		tmp = (t_1 * Math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
	} else {
		tmp = t_1 * Math.sqrt(((2.0 * z) * ((t * t) + 1.0)));
	}
	return tmp;
}
t = abs(t)
def code(x, y, z, t):
	t_1 = (x * 0.5) - y
	tmp = 0
	if (2.0 * z) <= 5e+80:
		tmp = (t_1 * math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)))
	else:
		tmp = t_1 * math.sqrt(((2.0 * z) * ((t * t) + 1.0)))
	return tmp
t = abs(t)
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (Float64(2.0 * z) <= 5e+80)
		tmp = Float64(Float64(t_1 * sqrt(Float64(2.0 * z))) * Float64(1.0 + Float64(0.5 * Float64(t * t))));
	else
		tmp = Float64(t_1 * sqrt(Float64(Float64(2.0 * z) * Float64(Float64(t * t) + 1.0))));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(x, y, z, t)
	t_1 = (x * 0.5) - y;
	tmp = 0.0;
	if ((2.0 * z) <= 5e+80)
		tmp = (t_1 * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
	else
		tmp = t_1 * sqrt(((2.0 * z) * ((t * t) + 1.0)));
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(2.0 * z), $MachinePrecision], 5e+80], N[(N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;2 \cdot z \leq 5 \cdot 10^{+80}:\\
\;\;\;\;\left(t_1 \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 2) < 4.99999999999999961e80

    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 81.7%

      \[\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. unpow281.7%

        \[\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. Simplified81.7%

      \[\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 4.99999999999999961e80 < (*.f64 z 2)

    1. Initial program 99.9%

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

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

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

      \[\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-u96.8%

        \[\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-udef96.8%

        \[\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. sqrt-unprod96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;2 \cdot z \leq 5 \cdot 10^{+80}:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}\\ \end{array} \]

Alternative 4: 86.7% accurate, 1.8× speedup?

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

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


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

    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. Step-by-step derivation
      1. associate-*l*99.7%

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

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

      \[\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-u96.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-udef56.6%

        \[\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. sqrt-unprod56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.00949999999999999976 < (*.f64 t t)

    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. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)} \]
    4. Step-by-step derivation
      1. add-exp-log100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.8% accurate, 1.8× speedup?

\[\begin{array}{l} t = |t|\\ \\ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{2 \cdot z} \cdot \left(1 + t \cdot \left(0.5 \cdot t\right)\right)\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (* (- (* x 0.5) y) (* (sqrt (* 2.0 z)) (+ 1.0 (* t (* 0.5 t))))))
t = abs(t);
double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * (sqrt((2.0 * z)) * (1.0 + (t * (0.5 * t))));
}
NOTE: t should be positive before calling this function
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 * (0.5d0 * t))))
end function
t = Math.abs(t);
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 * (0.5 * t))));
}
t = abs(t)
def code(x, y, z, t):
	return ((x * 0.5) - y) * (math.sqrt((2.0 * z)) * (1.0 + (t * (0.5 * t))))
t = abs(t)
function code(x, y, z, t)
	return Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt(Float64(2.0 * z)) * Float64(1.0 + Float64(t * Float64(0.5 * t)))))
end
t = abs(t)
function tmp = code(x, y, z, t)
	tmp = ((x * 0.5) - y) * (sqrt((2.0 * z)) * (1.0 + (t * (0.5 * t))));
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(t * N[(0.5 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{2 \cdot z} \cdot \left(1 + t \cdot \left(0.5 \cdot t\right)\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. 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. associate-*l/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.8% accurate, 1.9× speedup?

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

      \[\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-udef78.3%

      \[\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. sqrt-unprod78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 43.9% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := \sqrt{2 \cdot z}\\ \mathbf{if}\;y \leq -6200000000:\\ \;\;\;\;\sqrt{z \cdot \left(2 \cdot \left(y \cdot y\right)\right)}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+14}:\\ \;\;\;\;\left(x \cdot 0.5\right) \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(-y\right)\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* 2.0 z))))
   (if (<= y -6200000000.0)
     (sqrt (* z (* 2.0 (* y y))))
     (if (<= y 1.1e+14) (* (* x 0.5) t_1) (* t_1 (- y))))))
t = abs(t);
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((2.0 * z));
	double tmp;
	if (y <= -6200000000.0) {
		tmp = sqrt((z * (2.0 * (y * y))));
	} else if (y <= 1.1e+14) {
		tmp = (x * 0.5) * t_1;
	} else {
		tmp = t_1 * -y;
	}
	return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt((2.0d0 * z))
    if (y <= (-6200000000.0d0)) then
        tmp = sqrt((z * (2.0d0 * (y * y))))
    else if (y <= 1.1d+14) then
        tmp = (x * 0.5d0) * t_1
    else
        tmp = t_1 * -y
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((2.0 * z));
	double tmp;
	if (y <= -6200000000.0) {
		tmp = Math.sqrt((z * (2.0 * (y * y))));
	} else if (y <= 1.1e+14) {
		tmp = (x * 0.5) * t_1;
	} else {
		tmp = t_1 * -y;
	}
	return tmp;
}
t = abs(t)
def code(x, y, z, t):
	t_1 = math.sqrt((2.0 * z))
	tmp = 0
	if y <= -6200000000.0:
		tmp = math.sqrt((z * (2.0 * (y * y))))
	elif y <= 1.1e+14:
		tmp = (x * 0.5) * t_1
	else:
		tmp = t_1 * -y
	return tmp
t = abs(t)
function code(x, y, z, t)
	t_1 = sqrt(Float64(2.0 * z))
	tmp = 0.0
	if (y <= -6200000000.0)
		tmp = sqrt(Float64(z * Float64(2.0 * Float64(y * y))));
	elseif (y <= 1.1e+14)
		tmp = Float64(Float64(x * 0.5) * t_1);
	else
		tmp = Float64(t_1 * Float64(-y));
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((2.0 * z));
	tmp = 0.0;
	if (y <= -6200000000.0)
		tmp = sqrt((z * (2.0 * (y * y))));
	elseif (y <= 1.1e+14)
		tmp = (x * 0.5) * t_1;
	else
		tmp = t_1 * -y;
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -6200000000.0], N[Sqrt[N[(z * N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 1.1e+14], N[(N[(x * 0.5), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * (-y)), $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;y \leq -6200000000:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot \left(y \cdot y\right)\right)}\\

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

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


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

    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.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{z \cdot \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(-y\right) \cdot \left(-y\right)\right)\right)}} \]
      8. add-sqr-sqrt55.5%

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

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

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

    if -6.2e9 < y < 1.1e14

    1. Initial program 99.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 53.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \left(0.25 \cdot \color{blue}{\left(x \cdot x\right)}\right)} \cdot 1 \]
      2. *-commutative20.7%

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot 0.25\right)}} \cdot 1 \]
      3. associate-*l*20.7%

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot 0.25\right)\right)}} \cdot 1 \]
    7. Simplified20.7%

      \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot 0.25\right)\right)}} \cdot 1 \]
    8. Step-by-step derivation
      1. *-commutative20.7%

        \[\leadsto \sqrt{\color{blue}{\left(x \cdot \left(x \cdot 0.25\right)\right) \cdot \left(z \cdot 2\right)}} \cdot 1 \]
      2. sqrt-prod21.5%

        \[\leadsto \color{blue}{\left(\sqrt{x \cdot \left(x \cdot 0.25\right)} \cdot \sqrt{z \cdot 2}\right)} \cdot 1 \]
      3. sqrt-prod22.1%

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

        \[\leadsto \left(\left(\sqrt{x} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{0.25}\right)}\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1 \]
      5. metadata-eval22.1%

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

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

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

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

    if 1.1e14 < 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 64.1%

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \left(-y\right)\right)} \cdot \sqrt{z} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out52.8%

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

        \[\leadsto \color{blue}{-\left(\sqrt{2} \cdot y\right) \cdot \sqrt{z}} \]
      3. add-sqr-sqrt52.7%

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

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

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

        \[\leadsto -\left(\sqrt{2} \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right) \cdot \sqrt{z} \]
      7. add-sqr-sqrt0.8%

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

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

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

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

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

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

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

        \[\leadsto -\sqrt{2 \cdot z} \cdot \sqrt{\color{blue}{y \cdot y}} \]
      15. sqrt-unprod52.6%

        \[\leadsto -\sqrt{2 \cdot z} \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \]
      16. add-sqr-sqrt52.8%

        \[\leadsto -\sqrt{2 \cdot z} \cdot \color{blue}{y} \]
    7. Applied egg-rr52.8%

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

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

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

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

Alternative 8: 37.0% accurate, 2.0× speedup?

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

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


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

    1. Initial program 99.3%

      \[\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.7%

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \left(-y\right)\right)} \cdot \sqrt{z} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out38.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\sqrt{\color{blue}{2 \cdot z}} \cdot \left(-y\right) \]
      12. add-sqr-sqrt1.6%

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

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

        \[\leadsto -\sqrt{2 \cdot z} \cdot \sqrt{\color{blue}{y \cdot y}} \]
      15. sqrt-unprod17.9%

        \[\leadsto -\sqrt{2 \cdot z} \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \]
      16. add-sqr-sqrt38.5%

        \[\leadsto -\sqrt{2 \cdot z} \cdot \color{blue}{y} \]
    7. Applied egg-rr38.5%

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

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

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

    if 3.04999999999999996e72 < x

    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 56.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{0.5 \cdot \left(z \cdot \color{blue}{\left(x \cdot x\right)}\right)} \cdot 1 \]
    7. Simplified51.5%

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

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

Alternative 9: 56.8% accurate, 2.0× speedup?

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

      \[\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-udef78.3%

      \[\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. sqrt-unprod78.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 30.2% accurate, 2.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \left(-y\right)\right)} \cdot \sqrt{z} \]
  6. Step-by-step derivation
    1. distribute-rgt-neg-out33.4%

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

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

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

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

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

      \[\leadsto -\left(\sqrt{2} \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right) \cdot \sqrt{z} \]
    7. add-sqr-sqrt2.5%

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

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

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

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

      \[\leadsto -\sqrt{\color{blue}{2 \cdot z}} \cdot \left(-y\right) \]
    12. add-sqr-sqrt1.4%

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

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

      \[\leadsto -\sqrt{2 \cdot z} \cdot \sqrt{\color{blue}{y \cdot y}} \]
    15. sqrt-unprod16.0%

      \[\leadsto -\sqrt{2 \cdot z} \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \]
    16. add-sqr-sqrt33.4%

      \[\leadsto -\sqrt{2 \cdot z} \cdot \color{blue}{y} \]
  7. Applied egg-rr33.4%

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

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

    \[\leadsto \color{blue}{\sqrt{2 \cdot z} \cdot \left(-y\right)} \]
  10. Final simplification33.4%

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

Alternative 11: 2.4% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{2 \cdot z}} \cdot \left(-y\right)\right)} - 1 \]
    7. add-sqr-sqrt14.0%

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

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{2 \cdot z} \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)} - 1 \]
    9. sqr-neg15.7%

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

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{2 \cdot z} \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)} - 1 \]
    11. add-sqr-sqrt1.9%

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

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot z} \cdot y} \]
    3. *-commutative2.5%

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

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

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

Developer target: 99.5% accurate, 0.7× speedup?

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

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

Reproduce

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