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

Percentage Accurate: 99.5% → 99.8%
Time: 13.6s
Alternatives: 8
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

\\
\sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)} \cdot \left(0.5 \cdot x - 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. Step-by-step derivation
    1. expm1-log1p-u52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot t \leq 0.0001 \lor \neg \left(t \cdot t \leq 5 \cdot 10^{+306}\right):\\ \;\;\;\;\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-\sqrt{z \cdot 2}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (* t t) 0.0001) (not (<= (* t t) 5e+306)))
   (* (- (* 0.5 x) y) (sqrt (* 2.0 (* z (fma t t 1.0)))))
   (* (exp (/ (* t t) 2.0)) (* y (- (sqrt (* z 2.0)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((t * t) <= 0.0001) || !((t * t) <= 5e+306)) {
		tmp = ((0.5 * x) - y) * sqrt((2.0 * (z * fma(t, t, 1.0))));
	} else {
		tmp = exp(((t * t) / 2.0)) * (y * -sqrt((z * 2.0)));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(t * t) <= 0.0001) || !(Float64(t * t) <= 5e+306))
		tmp = Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * Float64(z * fma(t, t, 1.0)))));
	else
		tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-sqrt(Float64(z * 2.0)))));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(t * t), $MachinePrecision], 0.0001], N[Not[LessEqual[N[(t * t), $MachinePrecision], 5e+306]], $MachinePrecision]], N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(z * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 0.0001 \lor \neg \left(t \cdot t \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 1.00000000000000005e-4 or 4.99999999999999993e306 < (*.f64 t t)

    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. Step-by-step derivation
      1. expm1-log1p-u54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e-4 < (*.f64 t t) < 4.99999999999999993e306

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot t \leq 0.0001 \lor \neg \left(t \cdot t \leq 5 \cdot 10^{+306}\right):\\ \;\;\;\;\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-\sqrt{z \cdot 2}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 10^{+221}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.49999999999999987e-4

    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. Step-by-step derivation
      1. expm1-log1p-u52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.49999999999999987e-4 < t < 1e221

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e221 < 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. Step-by-step derivation
      1. expm1-log1p-u64.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 66.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+72}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot t\_2\right)\\

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


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

    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. Step-by-step derivation
      1. expm1-log1p-u53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 11000 < t < 2.59999999999999981e72

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.59999999999999981e72 < 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. Step-by-step derivation
      1. expm1-log1p-u52.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.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. Step-by-step derivation
      1. expm1-log1p-u53.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < t

    1. Initial program 100.0%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. expm1-log1p-u51.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.5% accurate, 1.0× speedup?

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

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

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Add Preprocessing
  3. Final simplification99.8%

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

Alternative 7: 58.0% accurate, 2.0× speedup?

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

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

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. expm1-log1p-u52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 31.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ y \cdot \left(-\sqrt{z \cdot 2}\right) \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 * Float64(-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 \left(-\sqrt{z \cdot 2}\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 60.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}} \]
  4. Step-by-step derivation
    1. mul-1-neg60.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-{\left(z \cdot 2\right)}^{0.5}\right)} \]
    2. unpow1/228.0%

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

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

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

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

Developer target: 99.5% accurate, 0.7× speedup?

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

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

Reproduce

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