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

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

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}
\end{array}
Derivation
  1. Initial program 99.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*99.4%

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

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

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

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

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

      \[\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. associate-*l*99.4%

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

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

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

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

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

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

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

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

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

Alternative 2: 58.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 2.8 \cdot 10^{+54}:\\ \;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+174} \lor \neg \left(t \leq 1.6 \cdot 10^{+223}\right):\\ \;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot {t\_1}^{2}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= t 2.8e+54)
     (* t_1 (sqrt (* 2.0 z)))
     (if (or (<= t 8.5e+174) (not (<= t 1.6e+223)))
       (* t_1 (cbrt (pow (* 2.0 z) 1.5)))
       (sqrt (* (* 2.0 z) (pow t_1 2.0)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 2.8e+54) {
		tmp = t_1 * sqrt((2.0 * z));
	} else if ((t <= 8.5e+174) || !(t <= 1.6e+223)) {
		tmp = t_1 * cbrt(pow((2.0 * z), 1.5));
	} else {
		tmp = sqrt(((2.0 * z) * pow(t_1, 2.0)));
	}
	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 <= 2.8e+54) {
		tmp = t_1 * Math.sqrt((2.0 * z));
	} else if ((t <= 8.5e+174) || !(t <= 1.6e+223)) {
		tmp = t_1 * Math.cbrt(Math.pow((2.0 * z), 1.5));
	} else {
		tmp = Math.sqrt(((2.0 * z) * Math.pow(t_1, 2.0)));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (t <= 2.8e+54)
		tmp = Float64(t_1 * sqrt(Float64(2.0 * z)));
	elseif ((t <= 8.5e+174) || !(t <= 1.6e+223))
		tmp = Float64(t_1 * cbrt((Float64(2.0 * z) ^ 1.5)));
	else
		tmp = sqrt(Float64(Float64(2.0 * z) * (t_1 ^ 2.0)));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 2.8e+54], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 8.5e+174], N[Not[LessEqual[t, 1.6e+223]], $MachinePrecision]], N[(t$95$1 * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 2.8 \cdot 10^{+54}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{+174} \lor \neg \left(t \leq 1.6 \cdot 10^{+223}\right):\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\

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


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

    1. Initial program 98.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.3%

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

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

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

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

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

        \[\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. associate-*l*99.3%

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

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

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

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

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

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

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

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

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

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

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

    if 2.80000000000000015e54 < t < 8.5000000000000007e174 or 1.6000000000000001e223 < 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. Taylor expanded in t around 0 22.3%

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left({\left(z \cdot 2\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333} \]
      6. *-commutative24.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left({\color{blue}{\left(2 \cdot z\right)}}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} \]
      7. metadata-eval24.8%

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

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

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

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

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

    if 8.5000000000000007e174 < t < 1.6000000000000001e223

    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 t around 0 4.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\color{blue}{\left(z \cdot 2\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}^{0.5} \]
      13. *-commutative43.1%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}^{0.5} \]
      14. pow243.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.8 \cdot 10^{+54}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+174} \lor \neg \left(t \leq 1.6 \cdot 10^{+223}\right):\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot {\left(x \cdot 0.5 - y\right)}^{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 91.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 18.5:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z + z \cdot {t}^{2}\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{0.5 \cdot {t}^{2}}\\


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

    1. Initial program 98.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.3%

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

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

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

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

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

        \[\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. associate-*l*99.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 18.5 < 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. associate-*l*100.0%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \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{z \cdot \left(2 \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{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}} \]
      2. associate-*r*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 78.1% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{0.5 \cdot {t}^{2}}\\


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

    1. Initial program 98.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.3%

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

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

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

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

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

        \[\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. associate-*l*99.3%

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

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

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

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

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

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

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

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

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

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

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

    if 17 < 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. associate-*l*100.0%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\sqrt{z \cdot \left(2 \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{z \cdot \left(2 \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{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}} \]
      2. associate-*r*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 59.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1.5 \cdot 10^{+42}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\

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


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

    1. Initial program 98.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.3%

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

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

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

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

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

        \[\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. associate-*l*99.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.50000000000000014e42 < 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 t around 0 20.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right) \cdot \color{blue}{\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right)}\right)}^{0.5} \]
      11. swap-sqr34.9%

        \[\leadsto {\color{blue}{\left(\left(\sqrt{z \cdot 2} \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}}^{0.5} \]
      12. add-sqr-sqrt34.9%

        \[\leadsto {\left(\color{blue}{\left(z \cdot 2\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}^{0.5} \]
      13. *-commutative34.9%

        \[\leadsto {\left(\color{blue}{\left(2 \cdot z\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)\right)}^{0.5} \]
      14. pow234.9%

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

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

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

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

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

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

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

Alternative 6: 99.6% accurate, 1.0× speedup?

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

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

Alternative 7: 42.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+135} \lor \neg \left(y \leq 2.9 \cdot 10^{+47}\right):\\
\;\;\;\;y \cdot \left(-t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3e135 or 2.8999999999999998e47 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\sqrt{\color{blue}{y \cdot y}} \cdot \sqrt{2 \cdot z} \]
      19. sqrt-unprod30.7%

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

        \[\leadsto -\color{blue}{y} \cdot \sqrt{2 \cdot z} \]
    10. Applied egg-rr57.4%

      \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
    11. Step-by-step derivation
      1. distribute-rgt-neg-in57.4%

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

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

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

    if -1.3e135 < y < 2.8999999999999998e47

    1. Initial program 98.6%

      \[\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 t around 0 59.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(0.5 \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right)\right)}^{1} \]
    10. Applied egg-rr46.4%

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

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

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

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

Alternative 8: 56.9% accurate, 2.0× speedup?

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

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}
\end{array}
Derivation
  1. Initial program 99.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*99.4%

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

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

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

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

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

      \[\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. associate-*l*99.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 30.2% accurate, 2.0× speedup?

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

\\
y \cdot \left(-\sqrt{2 \cdot z}\right)
\end{array}
Derivation
  1. Initial program 99.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 t around 0 62.2%

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(-y \cdot \sqrt{z}\right)} \]
    2. distribute-lft-neg-out30.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{y} \cdot \sqrt{2 \cdot z} \]
  10. Applied egg-rr30.2%

    \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
  11. Step-by-step derivation
    1. distribute-rgt-neg-in30.2%

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

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

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

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

Alternative 10: 2.3% accurate, 2.0× speedup?

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

\\
y \cdot \sqrt{2 \cdot z}
\end{array}
Derivation
  1. Initial program 99.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 t around 0 62.2%

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(-y \cdot \sqrt{z}\right)} \]
    2. distribute-lft-neg-out30.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.6% 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 2024086 
(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))))