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

Percentage Accurate: 99.4% → 99.4%
Time: 11.4s
Alternatives: 7
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 7 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 1.0× speedup?

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

\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
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. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z \cdot 2}\\ t_2 := e^{\frac{t \cdot t}{2}}\\ \mathbf{if}\;x \leq -0.0122 \lor \neg \left(x \leq 1.05 \cdot 10^{-69}\right):\\ \;\;\;\;t\_2 \cdot \left(0.5 \cdot \left(x \cdot t\_1\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 (or (<= x -0.0122) (not (<= x 1.05e-69)))
     (* t_2 (* 0.5 (* x 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 ((x <= -0.0122) || !(x <= 1.05e-69)) {
		tmp = t_2 * (0.5 * (x * 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 ((x <= (-0.0122d0)) .or. (.not. (x <= 1.05d-69))) then
        tmp = t_2 * (0.5d0 * (x * 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 ((x <= -0.0122) || !(x <= 1.05e-69)) {
		tmp = t_2 * (0.5 * (x * 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 (x <= -0.0122) or not (x <= 1.05e-69):
		tmp = t_2 * (0.5 * (x * 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 ((x <= -0.0122) || !(x <= 1.05e-69))
		tmp = Float64(t_2 * Float64(0.5 * Float64(x * 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 ((x <= -0.0122) || ~((x <= 1.05e-69)))
		tmp = t_2 * (0.5 * (x * 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[Or[LessEqual[x, -0.0122], N[Not[LessEqual[x, 1.05e-69]], $MachinePrecision]], N[(t$95$2 * N[(0.5 * N[(x * t$95$1), $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}\;x \leq -0.0122 \lor \neg \left(x \leq 1.05 \cdot 10^{-69}\right):\\
\;\;\;\;t\_2 \cdot \left(0.5 \cdot \left(x \cdot t\_1\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 x < -0.0122000000000000008 or 1.05e-69 < x

    1. Initial program 99.8%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0122000000000000008 < x < 1.05e-69

    1. Initial program 99.9%

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

      \[\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}} \]
    4. Step-by-step derivation
      1. mul-1-neg83.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.0122 \lor \neg \left(x \leq 1.05 \cdot 10^{-69}\right):\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(0.5 \cdot \left(x \cdot \sqrt{z \cdot 2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(-y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-18}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(-y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.65000000000000005e192

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(x \cdot 0.5\right)} \cdot \left(\sqrt{z} \cdot \sqrt{2}\right) - y \cdot \left(\sqrt{z} \cdot \sqrt{2}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. distribute-rgt-out--99.6%

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

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

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

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

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

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

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

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

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

    if -1.65000000000000005e192 < x < 4.79999999999999988e-18

    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. Add Preprocessing
    3. Taylor expanded in x around 0 74.5%

      \[\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}} \]
    4. Step-by-step derivation
      1. mul-1-neg74.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.79999999999999988e-18 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(x \cdot 0.5\right)} \cdot \left(\sqrt{z} \cdot \sqrt{2}\right) - y \cdot \left(\sqrt{z} \cdot \sqrt{2}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. distribute-rgt-out--99.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 41.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-79} \lor \neg \left(y \leq 3.6 \cdot 10^{+164}\right):\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(-y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.45e-79 or 3.5999999999999999e164 < y

    1. Initial program 99.9%

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

      \[\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}} \]
    4. Step-by-step derivation
      1. mul-1-neg84.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      9. pow1/26.9%

        \[\leadsto \left(y \cdot \color{blue}{{\left(z \cdot 2\right)}^{0.5}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. *-commutative6.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{z} \cdot y\right)} \]
    13. Step-by-step derivation
      1. associate-*r*1.0%

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot z}} \cdot y \]
      3. add-sqr-sqrt0.3%

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

        \[\leadsto \sqrt{2 \cdot z} \cdot \color{blue}{\sqrt{y \cdot y}} \]
      5. sqr-neg32.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - y \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      16. *-commutative55.5%

        \[\leadsto 0 - y \cdot \sqrt{\color{blue}{2 \cdot z}} \]
    14. Applied egg-rr55.5%

      \[\leadsto \color{blue}{0 - y \cdot \sqrt{2 \cdot z}} \]
    15. Step-by-step derivation
      1. neg-sub055.5%

        \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
      2. distribute-lft-neg-in55.5%

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

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

    if -1.45e-79 < y < 3.5999999999999999e164

    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. Add Preprocessing
    3. Taylor expanded in x around 0 99.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(x \cdot 0.5\right)} \cdot \left(\sqrt{z} \cdot \sqrt{2}\right) - y \cdot \left(\sqrt{z} \cdot \sqrt{2}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. distribute-rgt-out--99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 31.7% accurate, 1.0× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in x around 0 56.5%

      \[\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}} \]
    4. Step-by-step derivation
      1. mul-1-neg56.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      9. pow1/28.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{z} \cdot y\right)} \]
    13. Step-by-step derivation
      1. associate-*r*3.0%

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot z}} \cdot y \]
      3. add-sqr-sqrt1.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - y \cdot \color{blue}{\sqrt{z \cdot 2}} \]
      16. *-commutative35.7%

        \[\leadsto 0 - y \cdot \sqrt{\color{blue}{2 \cdot z}} \]
    14. Applied egg-rr35.7%

      \[\leadsto \color{blue}{0 - y \cdot \sqrt{2 \cdot z}} \]
    15. Step-by-step derivation
      1. neg-sub035.7%

        \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
      2. distribute-lft-neg-in35.7%

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

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

    if 3.2e6 < 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. Add Preprocessing
    3. Taylor expanded in x around 0 64.3%

      \[\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}} \]
    4. Step-by-step derivation
      1. mul-1-neg64.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      9. pow1/230.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 29.7% accurate, 2.0× speedup?

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

\\
\sqrt{z \cdot 2} \cdot \left(-y\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. Add Preprocessing
  3. Taylor expanded in x around 0 58.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}} \]
  4. Step-by-step derivation
    1. mul-1-neg58.2%

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

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

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

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

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

    \[\leadsto \color{blue}{\left(y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
  6. Step-by-step derivation
    1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    9. pow1/213.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{z} \cdot y\right)} \]
  13. Step-by-step derivation
    1. associate-*r*2.6%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot z}} \cdot y \]
    3. add-sqr-sqrt1.1%

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

      \[\leadsto \sqrt{2 \cdot z} \cdot \color{blue}{\sqrt{y \cdot y}} \]
    5. sqr-neg15.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 0 - y \cdot \color{blue}{\sqrt{z \cdot 2}} \]
    16. *-commutative29.1%

      \[\leadsto 0 - y \cdot \sqrt{\color{blue}{2 \cdot z}} \]
  14. Applied egg-rr29.1%

    \[\leadsto \color{blue}{0 - y \cdot \sqrt{2 \cdot z}} \]
  15. Step-by-step derivation
    1. neg-sub029.1%

      \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
    2. distribute-lft-neg-in29.1%

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

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

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

Alternative 7: 2.3% accurate, 2.0× speedup?

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

\\
y \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. Add Preprocessing
  3. Taylor expanded in x around 0 58.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}} \]
  4. Step-by-step derivation
    1. mul-1-neg58.2%

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

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

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

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

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

    \[\leadsto \color{blue}{\left(y \cdot \left(\sqrt{z} \cdot \left(-\sqrt{2}\right)\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
  6. Step-by-step derivation
    1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    9. pow1/213.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{z} \cdot y\right)} \]
  13. Step-by-step derivation
    1. associate-*r*2.6%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot z}} \cdot y \]
    3. add-sqr-sqrt1.1%

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

      \[\leadsto \sqrt{2 \cdot z} \cdot \color{blue}{\sqrt{y \cdot y}} \]
    5. sqr-neg15.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \sqrt{2 \cdot z} + \left(1 - 1\right)} \]
    5. metadata-eval2.6%

      \[\leadsto y \cdot \sqrt{2 \cdot z} + \color{blue}{0} \]
    6. +-rgt-identity2.6%

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

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

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

Developer target: 99.4% accurate, 0.7× speedup?

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

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

Reproduce

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

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

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