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

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

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.7% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8e7 < (*.f64 t t)

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add099.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(z \cdot 2\right) \cdot {\color{blue}{\left(\mathsf{fma}\left(x, 0.5, -y\right)\right)}}^{2} - 0 \cdot 0}{\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2} - 0} \cdot e^{\frac{t \cdot t}{2}} \]
      9. metadata-eval82.2%

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

        \[\leadsto \frac{\left(z \cdot 2\right) \cdot {\left(\mathsf{fma}\left(x, 0.5, -y\right)\right)}^{2} - 0}{\color{blue}{\mathsf{fma}\left(x, 0.5, -y\right)} \cdot \sqrt{z \cdot 2} - 0} \cdot e^{\frac{t \cdot t}{2}} \]
    4. Applied egg-rr82.2%

      \[\leadsto \color{blue}{\frac{\left(z \cdot 2\right) \cdot {\left(\mathsf{fma}\left(x, 0.5, -y\right)\right)}^{2} - 0}{\mathsf{fma}\left(x, 0.5, -y\right) \cdot \sqrt{z \cdot 2} - 0}} \cdot e^{\frac{t \cdot t}{2}} \]
    5. Step-by-step derivation
      1. --rgt-identity82.2%

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

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

        \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(x, 0.5, -y\right)\right)}^{2} \cdot \left(z \cdot 2\right)}}{\mathsf{fma}\left(x, 0.5, -y\right) \cdot \sqrt{z \cdot 2}} \cdot e^{\frac{t \cdot t}{2}} \]
      4. times-frac95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 59.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.50000000000000016e37 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

Alternative 5: 99.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 6: 59.5% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;t \leq 1.25 \cdot 10^{+181}:\\
\;\;\;\;\frac{1}{t\_2} \cdot \left(t\_1 \cdot \left(z \cdot 2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{z \cdot -2}{\frac{-t\_2}{t\_1}}\\


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.95e-10 < t < 1.2500000000000001e181

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2500000000000001e181 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot -2}{\color{blue}{\left(-\sqrt{2 \cdot z}\right) \cdot \frac{1}{x \cdot 0.5 - y}}} \]
      2. distribute-lft-neg-out27.6%

        \[\leadsto \frac{z \cdot -2}{\color{blue}{-\sqrt{2 \cdot z} \cdot \frac{1}{x \cdot 0.5 - y}}} \]
      3. associate-*r/27.6%

        \[\leadsto \frac{z \cdot -2}{-\color{blue}{\frac{\sqrt{2 \cdot z} \cdot 1}{x \cdot 0.5 - y}}} \]
      4. *-rgt-identity27.6%

        \[\leadsto \frac{z \cdot -2}{-\frac{\color{blue}{\sqrt{2 \cdot z}}}{x \cdot 0.5 - y}} \]
      5. *-commutative27.6%

        \[\leadsto \frac{z \cdot -2}{-\frac{\sqrt{2 \cdot z}}{\color{blue}{0.5 \cdot x} - y}} \]
    7. Simplified27.6%

      \[\leadsto \color{blue}{\frac{z \cdot -2}{-\frac{\sqrt{2 \cdot z}}{0.5 \cdot x - y}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

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

Alternative 7: 59.4% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;t \leq 6.4 \cdot 10^{+180}:\\
\;\;\;\;\frac{t\_1 \cdot \left(z \cdot 2\right)}{t\_2}\\

\mathbf{else}:\\
\;\;\;\;\frac{z \cdot -2}{\frac{-t\_2}{t\_1}}\\


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000018e-11 < t < 6.39999999999999987e180

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.39999999999999987e180 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot -2}{\color{blue}{\left(-\sqrt{2 \cdot z}\right) \cdot \frac{1}{x \cdot 0.5 - y}}} \]
      2. distribute-lft-neg-out27.6%

        \[\leadsto \frac{z \cdot -2}{\color{blue}{-\sqrt{2 \cdot z} \cdot \frac{1}{x \cdot 0.5 - y}}} \]
      3. associate-*r/27.6%

        \[\leadsto \frac{z \cdot -2}{-\color{blue}{\frac{\sqrt{2 \cdot z} \cdot 1}{x \cdot 0.5 - y}}} \]
      4. *-rgt-identity27.6%

        \[\leadsto \frac{z \cdot -2}{-\frac{\color{blue}{\sqrt{2 \cdot z}}}{x \cdot 0.5 - y}} \]
      5. *-commutative27.6%

        \[\leadsto \frac{z \cdot -2}{-\frac{\sqrt{2 \cdot z}}{\color{blue}{0.5 \cdot x} - y}} \]
    7. Simplified27.6%

      \[\leadsto \color{blue}{\frac{z \cdot -2}{-\frac{\sqrt{2 \cdot z}}{0.5 \cdot x - y}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

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

Alternative 8: 59.3% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.95e-10 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 44.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;x \leq -6.4 \cdot 10^{+72} \lor \neg \left(x \leq 2.9 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{x \cdot z}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.4000000000000003e72 or 2.9000000000000001e61 < 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. Add Preprocessing
    3. Taylor expanded in t around 0 58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{x \cdot z}}{\sqrt{2 \cdot z}} \]

    if -6.4000000000000003e72 < x < 2.9000000000000001e61

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
      3. neg-sub039.8%

        \[\leadsto \color{blue}{0 - y \cdot \sqrt{2 \cdot z}} \]
      4. add-sqr-sqrt15.4%

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

        \[\leadsto 0 - \color{blue}{\sqrt{y \cdot y}} \cdot \sqrt{2 \cdot z} \]
      6. sqr-neg21.9%

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \sqrt{2 \cdot z} \cdot \color{blue}{y} \]
    8. Applied egg-rr39.8%

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

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

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

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

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

Alternative 10: 57.0% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 30.4% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
    3. neg-sub028.9%

      \[\leadsto \color{blue}{0 - y \cdot \sqrt{2 \cdot z}} \]
    4. add-sqr-sqrt11.6%

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

      \[\leadsto 0 - \color{blue}{\sqrt{y \cdot y}} \cdot \sqrt{2 \cdot z} \]
    6. sqr-neg16.4%

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

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

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

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

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

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

      \[\leadsto 0 - \sqrt{2 \cdot z} \cdot \sqrt{\color{blue}{y \cdot y}} \]
    13. sqrt-unprod11.6%

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

      \[\leadsto 0 - \sqrt{2 \cdot z} \cdot \color{blue}{y} \]
  8. Applied egg-rr28.9%

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

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

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

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

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

Alternative 12: 2.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2 \cdot z} \cdot \sqrt{\color{blue}{y \cdot y}} + 0 \]
    7. sqrt-unprod1.2%

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

      \[\leadsto \sqrt{2 \cdot z} \cdot \color{blue}{y} + 0 \]
  8. Applied egg-rr2.7%

    \[\leadsto \color{blue}{\sqrt{2 \cdot z} \cdot y + 0} \]
  9. Step-by-step derivation
    1. *-commutative2.7%

      \[\leadsto \color{blue}{y \cdot \sqrt{2 \cdot z}} + 0 \]
    2. add02.7%

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

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

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

Developer target: 99.5% accurate, 0.7× speedup?

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

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

Reproduce

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