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

Percentage Accurate: 99.5% → 99.5%
Time: 13.6s
Alternatives: 8
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 8 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.5% accurate, 1.0× speedup?

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

\\
e^{\frac{t \cdot t}{2}} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right)
\end{array}
Derivation
  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. Final simplification99.8%

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

Alternative 2: 85.6% accurate, 0.7× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. sqr-neg99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity99.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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*51.4%

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

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

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

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

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

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

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

    if 20 < (exp.f64 (/.f64 (*.f64 t t) 2))

    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 x around 0 70.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    3. Step-by-step derivation
      1. associate-*r*70.2%

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

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

        \[\leadsto \left(\sqrt{z} \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot \sqrt{2}\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      4. neg-mul-170.2%

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

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
      2. distribute-lft-neg-out70.2%

        \[\leadsto \left(\color{blue}{\left(-y \cdot \sqrt{2}\right)} \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      3. distribute-lft-neg-out70.2%

        \[\leadsto \color{blue}{\left(-\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
      4. add-sqr-sqrt46.3%

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

        \[\leadsto \left(-\left(\color{blue}{\sqrt{y \cdot y}} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      6. sqr-neg53.7%

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

        \[\leadsto \left(-\left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      8. add-sqr-sqrt25.6%

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

        \[\leadsto \left(-\color{blue}{\left(-y\right) \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. sqrt-prod25.6%

        \[\leadsto \left(-\left(-y\right) \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      11. *-commutative25.6%

        \[\leadsto \left(-\left(-y\right) \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      12. add-sqr-sqrt10.7%

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

        \[\leadsto \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      14. sqr-neg53.7%

        \[\leadsto \left(-\sqrt{\color{blue}{y \cdot y}} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      15. sqrt-unprod46.3%

        \[\leadsto \left(-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      16. add-sqr-sqrt70.2%

        \[\leadsto \left(-\color{blue}{y} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    6. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\left(-y \cdot \sqrt{z \cdot 2}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    7. Step-by-step derivation
      1. distribute-lft-neg-in70.2%

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

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

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

Alternative 3: 85.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z \cdot 2}\\ t_2 := e^{\frac{t \cdot t}{2}}\\ \mathbf{if}\;t_2 \leq 20:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(t_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(t_1 \cdot \left(-y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* z 2.0))) (t_2 (exp (/ (* t t) 2.0))))
   (if (<= t_2 20.0)
     (* (- (* x 0.5) y) (* t_1 (hypot 1.0 t)))
     (* t_2 (* t_1 (- y))))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((z * 2.0));
	double t_2 = exp(((t * t) / 2.0));
	double tmp;
	if (t_2 <= 20.0) {
		tmp = ((x * 0.5) - y) * (t_1 * hypot(1.0, t));
	} else {
		tmp = t_2 * (t_1 * -y);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((z * 2.0));
	double t_2 = Math.exp(((t * t) / 2.0));
	double tmp;
	if (t_2 <= 20.0) {
		tmp = ((x * 0.5) - y) * (t_1 * Math.hypot(1.0, t));
	} else {
		tmp = t_2 * (t_1 * -y);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.sqrt((z * 2.0))
	t_2 = math.exp(((t * t) / 2.0))
	tmp = 0
	if t_2 <= 20.0:
		tmp = ((x * 0.5) - y) * (t_1 * math.hypot(1.0, t))
	else:
		tmp = t_2 * (t_1 * -y)
	return tmp
function code(x, y, z, t)
	t_1 = sqrt(Float64(z * 2.0))
	t_2 = exp(Float64(Float64(t * t) / 2.0))
	tmp = 0.0
	if (t_2 <= 20.0)
		tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(t_1 * hypot(1.0, t)));
	else
		tmp = Float64(t_2 * Float64(t_1 * Float64(-y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((z * 2.0));
	t_2 = exp(((t * t) / 2.0));
	tmp = 0.0;
	if (t_2 <= 20.0)
		tmp = ((x * 0.5) - y) * (t_1 * hypot(1.0, t));
	else
		tmp = t_2 * (t_1 * -y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 20.0], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(t$95$1 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * (-y)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    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. Step-by-step derivation
      1. sqr-neg99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity99.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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*51.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*98.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}} \]
      2. sqrt-prod98.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot \sqrt{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    12. Applied egg-rr98.7%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot \sqrt{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    13. Step-by-step derivation
      1. fma-udef98.7%

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\mathsf{hypot}\left(1, t\right)}\right) \]
    14. Simplified98.7%

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

    if 20 < (exp.f64 (/.f64 (*.f64 t t) 2))

    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 x around 0 70.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    3. Step-by-step derivation
      1. associate-*r*70.2%

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

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

        \[\leadsto \left(\sqrt{z} \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot \sqrt{2}\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      4. neg-mul-170.2%

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

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
      2. distribute-lft-neg-out70.2%

        \[\leadsto \left(\color{blue}{\left(-y \cdot \sqrt{2}\right)} \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      3. distribute-lft-neg-out70.2%

        \[\leadsto \color{blue}{\left(-\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
      4. add-sqr-sqrt46.3%

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

        \[\leadsto \left(-\left(\color{blue}{\sqrt{y \cdot y}} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      6. sqr-neg53.7%

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

        \[\leadsto \left(-\left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      8. add-sqr-sqrt25.6%

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

        \[\leadsto \left(-\color{blue}{\left(-y\right) \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. sqrt-prod25.6%

        \[\leadsto \left(-\left(-y\right) \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      11. *-commutative25.6%

        \[\leadsto \left(-\left(-y\right) \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      12. add-sqr-sqrt10.7%

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

        \[\leadsto \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      14. sqr-neg53.7%

        \[\leadsto \left(-\sqrt{\color{blue}{y \cdot y}} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      15. sqrt-unprod46.3%

        \[\leadsto \left(-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      16. add-sqr-sqrt70.2%

        \[\leadsto \left(-\color{blue}{y} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    6. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\left(-y \cdot \sqrt{z \cdot 2}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    7. Step-by-step derivation
      1. distribute-lft-neg-in70.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{\frac{t \cdot t}{2}} \leq 20:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{hypot}\left(1, t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(-y\right)\right)\\ \end{array} \]

Alternative 4: 90.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z \cdot 2}\\ t_2 := e^{\frac{t \cdot t}{2}} \cdot \left(t_1 \cdot \left(-y\right)\right)\\ t_3 := x \cdot 0.5 - y\\ \mathbf{if}\;t \cdot t \leq 10:\\ \;\;\;\;t_3 \cdot \left(t_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\ \mathbf{elif}\;t \cdot t \leq 10^{+162}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \cdot t \leq 10^{+214}:\\ \;\;\;\;\sqrt{z} \cdot \left(t_3 \cdot \left(t \cdot \sqrt{2}\right)\right)\\ \mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+283}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3 \cdot \sqrt{z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* z 2.0)))
        (t_2 (* (exp (/ (* t t) 2.0)) (* t_1 (- y))))
        (t_3 (- (* x 0.5) y)))
   (if (<= (* t t) 10.0)
     (* t_3 (* t_1 (hypot 1.0 t)))
     (if (<= (* t t) 1e+162)
       t_2
       (if (<= (* t t) 1e+214)
         (* (sqrt z) (* t_3 (* t (sqrt 2.0))))
         (if (<= (* t t) 4e+283)
           t_2
           (* t_3 (sqrt (* z (* 2.0 (fma t t 1.0)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((z * 2.0));
	double t_2 = exp(((t * t) / 2.0)) * (t_1 * -y);
	double t_3 = (x * 0.5) - y;
	double tmp;
	if ((t * t) <= 10.0) {
		tmp = t_3 * (t_1 * hypot(1.0, t));
	} else if ((t * t) <= 1e+162) {
		tmp = t_2;
	} else if ((t * t) <= 1e+214) {
		tmp = sqrt(z) * (t_3 * (t * sqrt(2.0)));
	} else if ((t * t) <= 4e+283) {
		tmp = t_2;
	} else {
		tmp = t_3 * sqrt((z * (2.0 * fma(t, t, 1.0))));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = sqrt(Float64(z * 2.0))
	t_2 = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(t_1 * Float64(-y)))
	t_3 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (Float64(t * t) <= 10.0)
		tmp = Float64(t_3 * Float64(t_1 * hypot(1.0, t)));
	elseif (Float64(t * t) <= 1e+162)
		tmp = t_2;
	elseif (Float64(t * t) <= 1e+214)
		tmp = Float64(sqrt(z) * Float64(t_3 * Float64(t * sqrt(2.0))));
	elseif (Float64(t * t) <= 4e+283)
		tmp = t_2;
	else
		tmp = Float64(t_3 * sqrt(Float64(z * Float64(2.0 * fma(t, t, 1.0)))));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * (-y)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 10.0], N[(t$95$3 * N[(t$95$1 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+162], t$95$2, If[LessEqual[N[(t * t), $MachinePrecision], 1e+214], N[(N[Sqrt[z], $MachinePrecision] * N[(t$95$3 * N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 4e+283], t$95$2, N[(t$95$3 * N[Sqrt[N[(z * N[(2.0 * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \cdot t \leq 10^{+162}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+283}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sqrt{z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\


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

    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. Step-by-step derivation
      1. sqr-neg99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity99.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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*51.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*98.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}} \]
      2. sqrt-prod98.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot \sqrt{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    12. Applied egg-rr98.7%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot \sqrt{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    13. Step-by-step derivation
      1. fma-udef98.7%

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\mathsf{hypot}\left(1, t\right)}\right) \]
    14. Simplified98.7%

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

    if 10 < (*.f64 t t) < 9.9999999999999994e161 or 9.9999999999999995e213 < (*.f64 t t) < 3.99999999999999982e283

    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 x around 0 80.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    3. Step-by-step derivation
      1. associate-*r*80.4%

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

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

        \[\leadsto \left(\sqrt{z} \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot \sqrt{2}\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      4. neg-mul-180.4%

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

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

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

        \[\leadsto \left(\color{blue}{\left(-y \cdot \sqrt{2}\right)} \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      3. distribute-lft-neg-out80.4%

        \[\leadsto \color{blue}{\left(-\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
      4. add-sqr-sqrt52.2%

        \[\leadsto \left(-\left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      5. sqrt-unprod54.3%

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

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

        \[\leadsto \left(-\left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      8. add-sqr-sqrt13.0%

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

        \[\leadsto \left(-\color{blue}{\left(-y\right) \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. sqrt-prod13.0%

        \[\leadsto \left(-\left(-y\right) \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      11. *-commutative13.0%

        \[\leadsto \left(-\left(-y\right) \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      12. add-sqr-sqrt4.3%

        \[\leadsto \left(-\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      13. sqrt-unprod54.3%

        \[\leadsto \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      14. sqr-neg54.3%

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

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

        \[\leadsto \left(-\color{blue}{y} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    6. Applied egg-rr80.4%

      \[\leadsto \color{blue}{\left(-y \cdot \sqrt{z \cdot 2}\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    7. Step-by-step derivation
      1. distribute-lft-neg-in80.4%

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

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

    if 9.9999999999999994e161 < (*.f64 t t) < 9.9999999999999995e213

    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. sqr-neg100.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity100.0%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{\color{blue}{t \cdot t}}{2}}\right) \]
      14. 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. Simplified100.0%

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

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

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

        \[\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*100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    10. Simplified46.6%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    11. Taylor expanded in t around inf 44.5%

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

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

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

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

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

    if 3.99999999999999982e283 < (*.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. sqr-neg100.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity100.0%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{\color{blue}{t \cdot t}}{2}}\right) \]
      14. 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. Simplified100.0%

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

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

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

        \[\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*100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    10. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot t \leq 10:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{hypot}\left(1, t\right)\right)\\ \mathbf{elif}\;t \cdot t \leq 10^{+162}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(-y\right)\right)\\ \mathbf{elif}\;t \cdot t \leq 10^{+214}:\\ \;\;\;\;\sqrt{z} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(t \cdot \sqrt{2}\right)\right)\\ \mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+283}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(-y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\ \end{array} \]

Alternative 5: 66.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t_1 \cdot \sqrt{z \cdot 2}\\

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


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

    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. sqr-neg99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity99.7%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{\color{blue}{t \cdot t}}{2}}\right) \]
      14. 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-u97.9%

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

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

        \[\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*67.2%

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

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

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

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

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

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

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

    if 1 < 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. sqr-neg100.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity100.0%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{\color{blue}{t \cdot t}}{2}}\right) \]
      14. 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. Simplified100.0%

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

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

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

        \[\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*100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    11. Taylor expanded in t around inf 67.7%

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

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

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

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

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

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

Alternative 6: 65.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t_1 \cdot t_2\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot t\right)\\


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

    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. sqr-neg99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity99.7%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{\color{blue}{t \cdot t}}{2}}\right) \]
      14. 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-u97.9%

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

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

        \[\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*67.2%

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

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

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

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

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

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

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

    if 1 < 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. sqr-neg100.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1}{e^{\frac{t}{\frac{2}{-t}}}}} \]
      6. *-rgt-identity100.0%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{\color{blue}{t \cdot t}}{2}}\right) \]
      14. 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. Simplified100.0%

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

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

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

        \[\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*100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    11. Taylor expanded in t around inf 59.4%

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

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

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

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

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

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

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

Alternative 7: 57.2% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{\color{blue}{t \cdot t}}{2}}\right) \]
    14. 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.4%

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

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

      \[\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*74.4%

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

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

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

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

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

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

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

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

Alternative 8: 29.6% accurate, 2.0× speedup?

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

\\
\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5\right)
\end{array}
Derivation
  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 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 2023318 
(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))))