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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.0% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(0.5 \cdot \left(t_1 \cdot {t}^{2}\right)\right)\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

    if 2e5 < (*.f64 t t) < 2.00000000000000003e263

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000003e263 < (*.f64 t 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

Alternative 3: 76.2% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(0.5 \cdot \left(0.5 \cdot \left(x \cdot {t}^{2}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 4.99999999999999978e110

    1. Initial program 99.1%

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

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

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

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

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

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

    if 4.99999999999999978e110 < (*.f64 t 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{2 \cdot z}\\ \mathbf{if}\;t \cdot t \leq 200000:\\ \;\;\;\;\left(0.5 \cdot x - 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) 200000.0)
     (* (- (* 0.5 x) 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) <= 200000.0) {
		tmp = ((0.5 * x) - 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) <= 200000.0d0) then
        tmp = ((0.5d0 * x) - 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) <= 200000.0) {
		tmp = ((0.5 * x) - 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) <= 200000.0:
		tmp = ((0.5 * x) - 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) <= 200000.0)
		tmp = Float64(Float64(Float64(0.5 * x) - 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) <= 200000.0)
		tmp = ((0.5 * x) - 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], 200000.0], N[(N[(N[(0.5 * x), $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 200000:\\
\;\;\;\;\left(0.5 \cdot x - 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) < 2e5

    1. Initial program 99.6%

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

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

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

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

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

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

    if 2e5 < (*.f64 t t)

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot t \leq 200000:\\ \;\;\;\;\left(0.5 \cdot x - 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 5: 59.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.5 \cdot x - y\\ t_2 := \sqrt{2 \cdot z}\\ \mathbf{if}\;t \leq 1.9 \cdot 10^{+67}:\\ \;\;\;\;t_1 \cdot t_2\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+202}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot t_2\right)\\ \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 (- (* 0.5 x) y)) (t_2 (sqrt (* 2.0 z))))
   (if (<= t 1.9e+67)
     (* t_1 t_2)
     (if (<= t 5.5e+202)
       (* (exp (/ (* t t) 2.0)) (* y t_2))
       (* t_1 (cbrt (pow (* 2.0 z) 1.5)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (0.5 * x) - y;
	double t_2 = sqrt((2.0 * z));
	double tmp;
	if (t <= 1.9e+67) {
		tmp = t_1 * t_2;
	} else if (t <= 5.5e+202) {
		tmp = exp(((t * t) / 2.0)) * (y * t_2);
	} 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 = (0.5 * x) - y;
	double t_2 = Math.sqrt((2.0 * z));
	double tmp;
	if (t <= 1.9e+67) {
		tmp = t_1 * t_2;
	} else if (t <= 5.5e+202) {
		tmp = Math.exp(((t * t) / 2.0)) * (y * t_2);
	} 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(0.5 * x) - y)
	t_2 = sqrt(Float64(2.0 * z))
	tmp = 0.0
	if (t <= 1.9e+67)
		tmp = Float64(t_1 * t_2);
	elseif (t <= 5.5e+202)
		tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * t_2));
	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[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.9e+67], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t, 5.5e+202], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * t$95$2), $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 := 0.5 \cdot x - y\\
t_2 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \leq 1.9 \cdot 10^{+67}:\\
\;\;\;\;t_1 \cdot t_2\\

\mathbf{elif}\;t \leq 5.5 \cdot 10^{+202}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot t_2\right)\\

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 1.9000000000000001e67 < t < 5.50000000000000011e202

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.50000000000000011e202 < 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot {\left(\color{blue}{\left(z \cdot 2\right)} \cdot \sqrt{z \cdot 2}\right)}^{0.3333333333333333}\right) \]
      6. pow122.0%

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot {\color{blue}{\left({\left(z \cdot 2\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}\right) \]
      9. *-commutative22.0%

        \[\leadsto 0.5 \cdot \left(x \cdot {\left({\color{blue}{\left(2 \cdot z\right)}}^{\left(1 + 0.5\right)}\right)}^{0.3333333333333333}\right) \]
      10. metadata-eval22.0%

        \[\leadsto 0.5 \cdot \left(x \cdot {\left({\left(2 \cdot z\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}\right) \]
    12. Applied egg-rr42.3%

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}}\right) \]
    14. Simplified42.3%

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

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

Alternative 6: 99.3% accurate, 1.0× speedup?

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

Alternative 7: 58.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 1.82 \cdot 10^{+258}:\\
\;\;\;\;\sqrt{{x}^{2} \cdot \left(0.5 \cdot z\right)}\\

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+288}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\right)\\

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 9.00000000000000004e118 < t < 1.81999999999999999e258

    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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{0.25 \cdot \left(\left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \cdot \left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)\right)} \]
      6. sqrt-prod28.8%

        \[\leadsto \sqrt{0.25 \cdot \left(\left(x \cdot \sqrt{2 \cdot z}\right) \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right)\right)} \]
      7. swap-sqr35.5%

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

        \[\leadsto \sqrt{0.25 \cdot \left(\color{blue}{{x}^{2}} \cdot \left(\sqrt{2 \cdot z} \cdot \sqrt{2 \cdot z}\right)\right)} \]
      9. add-sqr-sqrt35.5%

        \[\leadsto \sqrt{0.25 \cdot \left({x}^{2} \cdot \color{blue}{\left(2 \cdot z\right)}\right)} \]
    12. Applied egg-rr35.5%

      \[\leadsto \color{blue}{\sqrt{0.25 \cdot \left({x}^{2} \cdot \left(2 \cdot z\right)\right)}} \]
    13. Step-by-step derivation
      1. *-commutative35.5%

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

        \[\leadsto \sqrt{\color{blue}{{x}^{2} \cdot \left(\left(2 \cdot z\right) \cdot 0.25\right)}} \]
      3. *-commutative35.5%

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

        \[\leadsto \sqrt{{x}^{2} \cdot \color{blue}{\left(z \cdot \left(2 \cdot 0.25\right)\right)}} \]
      5. metadata-eval35.5%

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

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

    if 1.81999999999999999e258 < t < 1.90000000000000004e288

    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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot {\left(\color{blue}{\left(z \cdot 2\right)} \cdot \sqrt{z \cdot 2}\right)}^{0.3333333333333333}\right) \]
      6. pow139.0%

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot {\color{blue}{\left({\left(z \cdot 2\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}\right) \]
      9. *-commutative39.0%

        \[\leadsto 0.5 \cdot \left(x \cdot {\left({\color{blue}{\left(2 \cdot z\right)}}^{\left(1 + 0.5\right)}\right)}^{0.3333333333333333}\right) \]
      10. metadata-eval39.0%

        \[\leadsto 0.5 \cdot \left(x \cdot {\left({\left(2 \cdot z\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}\right) \]
    12. Applied egg-rr39.0%

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}}\right) \]
    14. Simplified39.0%

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

    if 1.90000000000000004e288 < 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{{y}^{2} \cdot \left(2 \cdot z\right)}} \]
    11. Simplified0.3%

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

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

Alternative 8: 58.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.5 \cdot x - y\\ \mathbf{if}\;t \leq 4.8 \cdot 10^{+118}:\\ \;\;\;\;t_1 \cdot \sqrt{2 \cdot z}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{+227}:\\ \;\;\;\;\sqrt{{x}^{2} \cdot \left(0.5 \cdot z\right)}\\ \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 (- (* 0.5 x) y)))
   (if (<= t 4.8e+118)
     (* t_1 (sqrt (* 2.0 z)))
     (if (<= t 3.7e+227)
       (sqrt (* (pow x 2.0) (* 0.5 z)))
       (* t_1 (cbrt (pow (* 2.0 z) 1.5)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (0.5 * x) - y;
	double tmp;
	if (t <= 4.8e+118) {
		tmp = t_1 * sqrt((2.0 * z));
	} else if (t <= 3.7e+227) {
		tmp = sqrt((pow(x, 2.0) * (0.5 * 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 = (0.5 * x) - y;
	double tmp;
	if (t <= 4.8e+118) {
		tmp = t_1 * Math.sqrt((2.0 * z));
	} else if (t <= 3.7e+227) {
		tmp = Math.sqrt((Math.pow(x, 2.0) * (0.5 * 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(0.5 * x) - y)
	tmp = 0.0
	if (t <= 4.8e+118)
		tmp = Float64(t_1 * sqrt(Float64(2.0 * z)));
	elseif (t <= 3.7e+227)
		tmp = sqrt(Float64((x ^ 2.0) * Float64(0.5 * 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[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 4.8e+118], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e+227], N[Sqrt[N[(N[Power[x, 2.0], $MachinePrecision] * N[(0.5 * 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 := 0.5 \cdot x - y\\
\mathbf{if}\;t \leq 4.8 \cdot 10^{+118}:\\
\;\;\;\;t_1 \cdot \sqrt{2 \cdot z}\\

\mathbf{elif}\;t \leq 3.7 \cdot 10^{+227}:\\
\;\;\;\;\sqrt{{x}^{2} \cdot \left(0.5 \cdot z\right)}\\

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 4.8e118 < t < 3.6999999999999999e227

    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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{0.25 \cdot \left(\left(x \cdot \sqrt{2 \cdot z}\right) \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right)\right)} \]
      7. swap-sqr39.8%

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

        \[\leadsto \sqrt{0.25 \cdot \left(\color{blue}{{x}^{2}} \cdot \left(\sqrt{2 \cdot z} \cdot \sqrt{2 \cdot z}\right)\right)} \]
      9. add-sqr-sqrt39.8%

        \[\leadsto \sqrt{0.25 \cdot \left({x}^{2} \cdot \color{blue}{\left(2 \cdot z\right)}\right)} \]
    12. Applied egg-rr39.8%

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

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

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

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

        \[\leadsto \sqrt{{x}^{2} \cdot \color{blue}{\left(z \cdot \left(2 \cdot 0.25\right)\right)}} \]
      5. metadata-eval39.8%

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

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

    if 3.6999999999999999e227 < 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}}\right) \]
    14. Simplified43.1%

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

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

Alternative 9: 57.9% accurate, 1.0× speedup?

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

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

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 6.5e118 < 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{0.25} \cdot \left(\left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right) \cdot \left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)\right)} \]
      5. sqrt-prod23.7%

        \[\leadsto \sqrt{0.25 \cdot \left(\left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right) \cdot \left(x \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)\right)} \]
      6. sqrt-prod23.7%

        \[\leadsto \sqrt{0.25 \cdot \left(\left(x \cdot \sqrt{2 \cdot z}\right) \cdot \left(x \cdot \color{blue}{\sqrt{2 \cdot z}}\right)\right)} \]
      7. swap-sqr28.6%

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

        \[\leadsto \sqrt{0.25 \cdot \left(\color{blue}{{x}^{2}} \cdot \left(\sqrt{2 \cdot z} \cdot \sqrt{2 \cdot z}\right)\right)} \]
      9. add-sqr-sqrt28.6%

        \[\leadsto \sqrt{0.25 \cdot \left({x}^{2} \cdot \color{blue}{\left(2 \cdot z\right)}\right)} \]
    12. Applied egg-rr28.6%

      \[\leadsto \color{blue}{\sqrt{0.25 \cdot \left({x}^{2} \cdot \left(2 \cdot z\right)\right)}} \]
    13. Step-by-step derivation
      1. *-commutative28.6%

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

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

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

        \[\leadsto \sqrt{{x}^{2} \cdot \color{blue}{\left(z \cdot \left(2 \cdot 0.25\right)\right)}} \]
      5. metadata-eval28.6%

        \[\leadsto \sqrt{{x}^{2} \cdot \left(z \cdot \color{blue}{0.5}\right)} \]
    14. Simplified28.6%

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

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

Alternative 10: 43.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{2 \cdot z}\\ \mathbf{if}\;x \leq -3.6 \cdot 10^{+38} \lor \neg \left(x \leq 3.2 \cdot 10^{+119}\right):\\ \;\;\;\;\left(0.5 \cdot x\right) \cdot t_1\\ \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+38) (not (<= x 3.2e+119)))
     (* (* 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+38) || !(x <= 3.2e+119)) {
		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+38)) .or. (.not. (x <= 3.2d+119))) 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+38) || !(x <= 3.2e+119)) {
		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+38) or not (x <= 3.2e+119):
		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+38) || !(x <= 3.2e+119))
		tmp = Float64(Float64(0.5 * 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+38) || ~((x <= 3.2e+119)))
		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+38], N[Not[LessEqual[x, 3.2e+119]], $MachinePrecision]], N[(N[(0.5 * x), $MachinePrecision] * t$95$1), $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^{+38} \lor \neg \left(x \leq 3.2 \cdot 10^{+119}\right):\\
\;\;\;\;\left(0.5 \cdot x\right) \cdot t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.59999999999999969e38 or 3.19999999999999989e119 < 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. *-commutative99.8%

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

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

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

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

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

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

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

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

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

    if -3.59999999999999969e38 < x < 3.19999999999999989e119

    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. *-commutative99.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
    10. Step-by-step derivation
      1. *-commutative47.5%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot z} \cdot y} \]
      2. distribute-rgt-neg-in47.5%

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

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

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

Alternative 11: 57.8% accurate, 2.0× speedup?

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

\\
\left(0.5 \cdot x - 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. *-commutative99.4%

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

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

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

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

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

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

Alternative 12: 30.1% 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. Step-by-step derivation
    1. *-commutative99.4%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
  10. Step-by-step derivation
    1. *-commutative32.8%

      \[\leadsto -\color{blue}{\sqrt{2 \cdot z} \cdot y} \]
    2. distribute-rgt-neg-in32.8%

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

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

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

Alternative 13: 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. Step-by-step derivation
    1. *-commutative99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.3% 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 2024011 
(FPCore (x y z t)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
  :precision binary64

  :herbie-target
  (* (* (- (* 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))))