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

Percentage Accurate: 99.4% → 99.4%
Time: 12.7s
Alternatives: 9
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 9 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. Final simplification99.8%

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

Alternative 2: 92.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

    if 0.0126 < (*.f64 t t) < 6.0000000000000001e283

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 74.2% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 99.6%

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

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

    if 2.45000000000000016e131 < (*.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. Taylor expanded in x around 0 81.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. mul-1-neg81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.5% accurate, 1.8× speedup?

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

\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\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 85.4%

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

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

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

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

Alternative 5: 57.6% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

    if 1.89999999999999995e119 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(y \cdot \left(y \cdot 2\right)\right)}^{0.5} \cdot \sqrt{\color{blue}{z}}\right) \cdot 1 \]
      6. pow1/215.5%

        \[\leadsto \left({\left(y \cdot \left(y \cdot 2\right)\right)}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot 1 \]
      7. pow-prod-down15.5%

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

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

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

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

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

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

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

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

Alternative 6: 31.4% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in x around 0 64.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. mul-1-neg64.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*64.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\sqrt{z + z}\right)\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      2. expm1-log1p64.2%

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

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

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

    if 6.6e16 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(y \cdot \left(y \cdot 2\right)\right)}^{0.5} \cdot \sqrt{\color{blue}{z}}\right) \cdot 1 \]
      6. pow1/212.4%

        \[\leadsto \left({\left(y \cdot \left(y \cdot 2\right)\right)}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot 1 \]
      7. pow-prod-down15.9%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 32.1% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Taylor expanded in x around 0 64.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. mul-1-neg64.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*64.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\sqrt{z + z}\right)\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      2. expm1-log1p64.2%

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

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

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

    if 1.7e14 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(y \cdot \left(y \cdot 2\right)\right)}^{0.5} \cdot \sqrt{\color{blue}{z}}\right) \cdot 1 \]
      6. pow1/212.4%

        \[\leadsto \left({\left(y \cdot \left(y \cdot 2\right)\right)}^{0.5} \cdot \color{blue}{{z}^{0.5}}\right) \cdot 1 \]
      7. pow-prod-down15.9%

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

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

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

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

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

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

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

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

Alternative 8: 30.5% accurate, 2.0× speedup?

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

\\
y \cdot \left(-\sqrt{z + z}\right)
\end{array}
Derivation
  1. Initial program 99.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 x around 0 66.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}} \]
  3. Step-by-step derivation
    1. mul-1-neg66.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*66.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\sqrt{z + z}\right)\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. expm1-log1p66.3%

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

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

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

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

Alternative 9: 2.6% accurate, 215.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x y z t) :precision binary64 0.0)
double code(double x, double y, double z, double t) {
	return 0.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 = 0.0d0
end function
public static double code(double x, double y, double z, double t) {
	return 0.0;
}
def code(x, y, z, t):
	return 0.0
function code(x, y, z, t)
	return 0.0
end
function tmp = code(x, y, z, t)
	tmp = 0.0;
end
code[x_, y_, z_, t_] := 0.0
\begin{array}{l}

\\
0
\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 x around 0 66.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}} \]
  3. Step-by-step derivation
    1. mul-1-neg66.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*66.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\sqrt{z + z}\right)\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. expm1-log1p66.3%

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

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

    \[\leadsto \left(y \cdot \left(-\sqrt{z + z}\right)\right) \cdot \color{blue}{1} \]
  10. Step-by-step derivation
    1. add-log-exp33.1%

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

      \[\leadsto \log \color{blue}{\left({\left(e^{y}\right)}^{\left(-\sqrt{z + z}\right)}\right)} \cdot 1 \]
    3. add-sqr-sqrt1.6%

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

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

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left(\sqrt{\color{blue}{\sqrt{z + z} \cdot \sqrt{z + z}}}\right)}\right) \cdot 1 \]
    6. add-sqr-sqrt4.5%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left(\sqrt{\color{blue}{z + z}}\right)}\right) \cdot 1 \]
    7. pow1/24.5%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\color{blue}{\left({\left(z + z\right)}^{0.5}\right)}}\right) \cdot 1 \]
    8. add-sqr-sqrt4.5%

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

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \color{blue}{\left(-\sqrt{z}\right) \cdot \left(-\sqrt{z}\right)}\right)}^{0.5}\right)}\right) \cdot 1 \]
    10. neg-mul-14.5%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \color{blue}{\left(-1 \cdot \sqrt{z}\right)} \cdot \left(-\sqrt{z}\right)\right)}^{0.5}\right)}\right) \cdot 1 \]
    11. associate-*l*4.5%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \color{blue}{-1 \cdot \left(\sqrt{z} \cdot \left(-\sqrt{z}\right)\right)}\right)}^{0.5}\right)}\right) \cdot 1 \]
    12. metadata-eval4.5%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \color{blue}{\left(-1\right)} \cdot \left(\sqrt{z} \cdot \left(-\sqrt{z}\right)\right)\right)}^{0.5}\right)}\right) \cdot 1 \]
    13. add-sqr-sqrt1.6%

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

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \left(-1\right) \cdot \left(\sqrt{z} \cdot \color{blue}{\sqrt{\left(-\sqrt{z}\right) \cdot \left(-\sqrt{z}\right)}}\right)\right)}^{0.5}\right)}\right) \cdot 1 \]
    15. sqr-neg2.9%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \left(-1\right) \cdot \left(\sqrt{z} \cdot \sqrt{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}\right)\right)}^{0.5}\right)}\right) \cdot 1 \]
    16. add-sqr-sqrt2.9%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \left(-1\right) \cdot \left(\sqrt{z} \cdot \sqrt{\color{blue}{z}}\right)\right)}^{0.5}\right)}\right) \cdot 1 \]
    17. add-sqr-sqrt2.6%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z + \left(-1\right) \cdot \color{blue}{z}\right)}^{0.5}\right)}\right) \cdot 1 \]
    18. cancel-sign-sub-inv2.6%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\color{blue}{\left(z - 1 \cdot z\right)}}^{0.5}\right)}\right) \cdot 1 \]
    19. *-un-lft-identity2.6%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\left(z - \color{blue}{z}\right)}^{0.5}\right)}\right) \cdot 1 \]
    20. +-inverses2.6%

      \[\leadsto \log \left({\left(e^{y}\right)}^{\left({\color{blue}{0}}^{0.5}\right)}\right) \cdot 1 \]
  11. Applied egg-rr2.6%

    \[\leadsto \color{blue}{0} \cdot 1 \]
  12. Final simplification2.6%

    \[\leadsto 0 \]

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