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

Percentage Accurate: 99.5% → 99.8%
Time: 14.0s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
t_2 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 4 \cdot 10^{-7}:\\
\;\;\;\;t\_2 \cdot \left(\mathsf{hypot}\left(1, t\right) \cdot t\_1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 t t) < 3.9999999999999998e-7

    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. associate-*l*99.7%

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

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

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

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

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

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

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

      \[\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 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999998e-7 < (*.f64 t t) < 5.0000000000000004e286

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e286 < (*.f64 t t)

    1. Initial program 98.5%

      \[\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. Taylor expanded in t around 0 100.0%

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}} \]
    12. Taylor expanded in t around inf 100.0%

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

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

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

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

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

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

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

Alternative 4: 92.1% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 t t) < 3.9999999999999998e-7

    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. Taylor expanded in t around 0 99.0%

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

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

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

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

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

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

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

    if 3.9999999999999998e-7 < (*.f64 t t) < 5.0000000000000004e286

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e286 < (*.f64 t t)

    1. Initial program 98.5%

      \[\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. Taylor expanded in t around 0 100.0%

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}} \]
    12. Taylor expanded in t around inf 100.0%

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

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

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

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

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

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

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

Alternative 5: 85.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{2 \cdot z}\\ \mathbf{if}\;t \cdot t \leq 4 \cdot 10^{-7}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* 2.0 z))))
   (if (<= (* t t) 4e-7)
     (* (- (* x 0.5) y) t_1)
     (* (exp (/ (* t t) 2.0)) (* y (- t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((2.0 * z));
	double tmp;
	if ((t * t) <= 4e-7) {
		tmp = ((x * 0.5) - y) * t_1;
	} else {
		tmp = exp(((t * t) / 2.0)) * (y * -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 ((t * t) <= 4d-7) then
        tmp = ((x * 0.5d0) - y) * t_1
    else
        tmp = exp(((t * t) / 2.0d0)) * (y * -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 ((t * t) <= 4e-7) {
		tmp = ((x * 0.5) - y) * t_1;
	} else {
		tmp = Math.exp(((t * t) / 2.0)) * (y * -t_1);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.sqrt((2.0 * z))
	tmp = 0
	if (t * t) <= 4e-7:
		tmp = ((x * 0.5) - y) * t_1
	else:
		tmp = math.exp(((t * t) / 2.0)) * (y * -t_1)
	return tmp
function code(x, y, z, t)
	t_1 = sqrt(Float64(2.0 * z))
	tmp = 0.0
	if (Float64(t * t) <= 4e-7)
		tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1);
	else
		tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-t_1)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((2.0 * z));
	tmp = 0.0;
	if ((t * t) <= 4e-7)
		tmp = ((x * 0.5) - y) * t_1;
	else
		tmp = exp(((t * t) / 2.0)) * (y * -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[LessEqual[N[(t * t), $MachinePrecision], 4e-7], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * (-t$95$1)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 3.9999999999999998e-7

    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. Taylor expanded in t around 0 99.0%

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

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

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

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

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

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

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

    if 3.9999999999999998e-7 < (*.f64 t t)

    1. Initial program 99.2%

      \[\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 73.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 61.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 9.99999999999999955e-7

    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. Taylor expanded in t around 0 98.6%

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

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

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

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

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

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

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

    if 9.99999999999999955e-7 < (*.f64 t t)

    1. Initial program 99.2%

      \[\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. Taylor expanded in t around 0 67.6%

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}} \]
    12. Taylor expanded in t around inf 23.1%

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

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

Alternative 7: 64.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.3%

      \[\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. Taylor expanded in t around 0 69.9%

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

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

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

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

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

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

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

    if 1 < t

    1. Initial program 100.0%

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

        \[\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. Taylor expanded in t around 0 66.3%

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \color{blue}{\mathsf{fma}\left(t, t, 1\right)}} \]
    12. Taylor expanded in t around inf 47.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \mathsf{fma}\left(x, 0.5, -y\right)\right)\right)} \cdot t \]
      9. associate-*l*40.3%

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

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

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

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

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

Alternative 8: 59.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 3.2:\\ \;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= t 3.2)
     (* t_1 (sqrt (* 2.0 z)))
     (* t_1 (cbrt (pow (* 2.0 z) 1.5))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 3.2) {
		tmp = t_1 * sqrt((2.0 * z));
	} else {
		tmp = t_1 * cbrt(pow((2.0 * z), 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 <= 3.2) {
		tmp = t_1 * Math.sqrt((2.0 * z));
	} else {
		tmp = t_1 * Math.cbrt(Math.pow((2.0 * z), 1.5));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (t <= 3.2)
		tmp = Float64(t_1 * sqrt(Float64(2.0 * z)));
	else
		tmp = Float64(t_1 * cbrt((Float64(2.0 * z) ^ 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, 3.2], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[(2.0 * z), $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 3.2:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\

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


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

    1. Initial program 99.3%

      \[\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. Taylor expanded in t around 0 69.9%

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

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

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

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

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

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

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

    if 3.2000000000000002 < 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*99.9%

        \[\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 10.9%

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

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

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

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

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

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

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

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

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

        \[\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} \]
      10. pow125.9%

        \[\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} \]
      11. pow1/225.9%

        \[\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} \]
      12. pow-prod-up25.9%

        \[\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} \]
      13. metadata-eval25.9%

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

      \[\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/325.9%

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

      \[\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. Add Preprocessing

Alternative 9: 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{2 \cdot z}\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (exp (/ (* t t) 2.0)) (* (- (* x 0.5) y) (sqrt (* 2.0 z)))))
double code(double x, double y, double z, double t) {
	return exp(((t * t) / 2.0)) * (((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 = exp(((t * t) / 2.0d0)) * (((x * 0.5d0) - y) * sqrt((2.0d0 * z)))
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((2.0 * z)));
}
def code(x, y, z, t):
	return math.exp(((t * t) / 2.0)) * (((x * 0.5) - y) * math.sqrt((2.0 * z)))
function code(x, y, z, t)
	return Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))))
end
function tmp = code(x, y, z, t)
	tmp = exp(((t * t) / 2.0)) * (((x * 0.5) - y) * sqrt((2.0 * z)));
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[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

Alternative 10: 43.2% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-12} \lor \neg \left(x \leq 7 \cdot 10^{-69}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.6e-12 or 7.0000000000000003e-69 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e-12 < x < 7.0000000000000003e-69

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 57.1% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.3%

      \[\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. Taylor expanded in t around 0 67.2%

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

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

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

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

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

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

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

    if 2.0500000000000001e31 < 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 10.0%

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

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

        \[\leadsto \color{blue}{\sqrt{\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)}} \cdot 1 \]
      3. *-commutative28.4%

        \[\leadsto \sqrt{\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)} \cdot 1 \]
      4. *-commutative28.4%

        \[\leadsto \sqrt{\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)}} \cdot 1 \]
      5. swap-sqr32.0%

        \[\leadsto \sqrt{\color{blue}{\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)}} \cdot 1 \]
      6. add-sqr-sqrt32.0%

        \[\leadsto \sqrt{\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)} \cdot 1 \]
      7. pow232.0%

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

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

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

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

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \left(\left(-\color{blue}{y \cdot x}\right) + 0.25 \cdot {x}^{2}\right)} \cdot 1 \]
      3. distribute-lft-neg-in26.0%

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \left(\color{blue}{\left(-y\right) \cdot x} + 0.25 \cdot {x}^{2}\right)} \cdot 1 \]
      4. unpow226.0%

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

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \left(\left(-y\right) \cdot x + \color{blue}{\left(0.25 \cdot x\right) \cdot x}\right)} \cdot 1 \]
      6. distribute-rgt-in28.0%

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \color{blue}{\left(x \cdot \left(\left(-y\right) + 0.25 \cdot x\right)\right)}} \cdot 1 \]
      7. +-commutative28.0%

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \left(x \cdot \color{blue}{\left(0.25 \cdot x + \left(-y\right)\right)}\right)} \cdot 1 \]
      8. unsub-neg28.0%

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

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

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

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

Alternative 12: 56.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.3%

      \[\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. Taylor expanded in t around 0 67.2%

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

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

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

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

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

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

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

    if 3.05e37 < 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 10.0%

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

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

        \[\leadsto \color{blue}{\sqrt{\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)}} \cdot 1 \]
      3. *-commutative28.4%

        \[\leadsto \sqrt{\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)} \cdot 1 \]
      4. *-commutative28.4%

        \[\leadsto \sqrt{\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)}} \cdot 1 \]
      5. swap-sqr32.0%

        \[\leadsto \sqrt{\color{blue}{\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)}} \cdot 1 \]
      6. add-sqr-sqrt32.0%

        \[\leadsto \sqrt{\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)} \cdot 1 \]
      7. pow232.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{x \cdot \left(\left(-2 \cdot y\right) \cdot z + \color{blue}{\left(x \cdot 0.5\right)} \cdot z\right)} \cdot 1 \]
      12. distribute-rgt-out26.1%

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

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

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

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

Alternative 13: 56.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.3%

      \[\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. Taylor expanded in t around 0 67.9%

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

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

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

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

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

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

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

    if 2.4999999999999999e27 < 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 9.8%

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

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

        \[\leadsto \color{blue}{\sqrt{\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)}} \cdot 1 \]
      3. *-commutative29.2%

        \[\leadsto \sqrt{\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)} \cdot 1 \]
      4. *-commutative29.2%

        \[\leadsto \sqrt{\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)}} \cdot 1 \]
      5. swap-sqr32.7%

        \[\leadsto \sqrt{\color{blue}{\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)}} \cdot 1 \]
      6. add-sqr-sqrt32.7%

        \[\leadsto \sqrt{\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)} \cdot 1 \]
      7. pow232.7%

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

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

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

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

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

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot \left(y \cdot y + \color{blue}{\left(-1 \cdot x\right) \cdot y}\right)} \cdot 1 \]
      4. distribute-rgt-in21.5%

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

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

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

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

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

Alternative 14: 57.0% 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.4%

    \[\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. Taylor expanded in t around 0 55.6%

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

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

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

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

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

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

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

Alternative 15: 30.4% 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 2.4% 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y \cdot \sqrt{2 \cdot z}} \]
  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 2024100 
(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))))