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

Percentage Accurate: 99.4% → 99.8%
Time: 14.4s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.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. Final simplification99.8%

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

Alternative 2: 86.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64))) < 2

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

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

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

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

      \[\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 \left(\sqrt{z \cdot 2} \cdot \color{blue}{1}\right) \]
    6. Step-by-step derivation
      1. *-rgt-identity99.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2 < (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64)))

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

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

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

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

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

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

        \[\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*71.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{\frac{t \cdot t}{2}} \leq 2:\\ \;\;\;\;\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 3: 67.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 3.9 \cdot 10^{+46}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot {t\_1}^{2}}\\

\mathbf{elif}\;t \leq 2.8 \cdot 10^{+64}:\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\

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


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

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

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

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

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

        \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot 0.5 + \left(-y\right)\right)} \]
      4. distribute-lft-in71.3%

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

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

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

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

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

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

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

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

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

    if 3100 < t < 3.89999999999999995e46

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999995e46 < t < 2.80000000000000024e64

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.80000000000000024e64 < t

    1. Initial program 100.0%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 68.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-neg68.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-in68.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. Simplified68.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-out68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 67.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 5.4 \cdot 10^{+79}:\\
\;\;\;\;\left(x \cdot \left(\sqrt{z} \cdot \left(0.5 - \frac{y}{x}\right)\right)\right) \cdot \sqrt{2}\\

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


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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot z} \cdot \left(x \cdot 0.5\right) + \sqrt{\color{blue}{2 \cdot z}} \cdot \left(-y\right) \]
    7. Applied egg-rr71.6%

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

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

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

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

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

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

    if 2.65e-5 < t < 5.3999999999999999e79

    1. Initial program 95.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-sqrt99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(0.5 \cdot \sqrt{z} + \color{blue}{\left(-\frac{y}{x} \cdot \sqrt{z}\right)}\right)\right) \cdot \sqrt{2} \]
      3. unsub-neg35.7%

        \[\leadsto \left(x \cdot \color{blue}{\left(0.5 \cdot \sqrt{z} - \frac{y}{x} \cdot \sqrt{z}\right)}\right) \cdot \sqrt{2} \]
      4. distribute-rgt-out--35.7%

        \[\leadsto \left(x \cdot \color{blue}{\left(\sqrt{z} \cdot \left(0.5 - \frac{y}{x}\right)\right)}\right) \cdot \sqrt{2} \]
    12. Simplified35.7%

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

    if 5.3999999999999999e79 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 60.8% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

        \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot 0.5 + \left(-y\right)\right)} \]
      4. distribute-lft-in71.7%

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

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

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

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

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

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

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

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

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

    if 380 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 60.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 11500000000000:\\ \;\;\;\;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 11500000000000.0)
     (* 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 <= 11500000000000.0) {
		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 <= 11500000000000.0) {
		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 <= 11500000000000.0)
		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, 11500000000000.0], 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 11500000000000:\\
\;\;\;\;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 < 1.15e13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e13 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.4% 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 8: 57.8% 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 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 31.2% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.4% accurate, 0.7× speedup?

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

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

Reproduce

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