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

Percentage Accurate: 99.5% → 99.8%
Time: 13.7s
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.5× speedup?

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

\\
\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{{\left(e^{t}\right)}^{t}} \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. Step-by-step derivation
    1. associate-*l*99.8%

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

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

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

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

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

Alternative 2: 70.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t \leq 4 \cdot 10^{+43} \lor \neg \left(t \leq 9 \cdot 10^{+186}\right):\\
\;\;\;\;t\_1 \cdot \left(x \cdot \sqrt{0.5 \cdot z}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(y \cdot \left(-t\_2\right)\right)\\


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.8e6 < t < 4.00000000000000006e43 or 9.0000000000000009e186 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot {\left(\sqrt{\left(2 \cdot \color{blue}{0.25}\right) \cdot \left(\sqrt{z} \cdot \sqrt{z}\right)}\right)}^{1}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. metadata-eval74.1%

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

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

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

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

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

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

    if 4.00000000000000006e43 < t < 9.0000000000000009e186

    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 80.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. associate-*r*80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6800000:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{+43} \lor \neg \left(t \leq 9 \cdot 10^{+186}\right):\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(x \cdot \sqrt{0.5 \cdot z}\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: 70.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.8e6 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 59.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 28:\\ \;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= t 28.0)
     (* t_1 (sqrt (* z 2.0)))
     (* t_1 (cbrt (pow (* z 2.0) 1.5))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 28.0) {
		tmp = t_1 * sqrt((z * 2.0));
	} else {
		tmp = t_1 * cbrt(pow((z * 2.0), 1.5));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 28.0) {
		tmp = t_1 * Math.sqrt((z * 2.0));
	} else {
		tmp = t_1 * Math.cbrt(Math.pow((z * 2.0), 1.5));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (t <= 28.0)
		tmp = Float64(t_1 * sqrt(Float64(z * 2.0)));
	else
		tmp = Float64(t_1 * cbrt((Float64(z * 2.0) ^ 1.5)));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 28.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[(z * 2.0), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}}\\


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 28 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left({\left(2 \cdot z\right)}^{1} \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.5}}\right)}^{0.3333333333333333} \]
      6. pow-prod-up23.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left({\left(2 \cdot z\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333} \]
      7. metadata-eval23.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left({\left(2 \cdot z\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} \]
    11. Applied egg-rr23.6%

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}} \]
    13. Simplified23.6%

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

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

Alternative 5: 99.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 6: 56.4% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 30.0% 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 62.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. associate-*r*62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 2.5% accurate, 2.0× speedup?

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

\\
y \cdot \sqrt{z \cdot 2}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 62.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. associate-*r*62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto y \cdot \sqrt{z \cdot 2} \]
  13. 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 2024085 
(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))))