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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{\frac{t \cdot t}{2}} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{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.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. Final simplification99.8%

    \[\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 2: 71.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5\right) \cdot \sqrt{z \cdot 2} - \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
      11. cancel-sign-sub-inv33.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6200 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

Alternative 3: 55.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+244} \lor \neg \left(y \leq -6.2 \cdot 10^{+112}\right):\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.0599999999999999e244 or -6.19999999999999965e112 < y

    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 60.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*59.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5\right) \cdot \sqrt{z \cdot 2} - \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
      11. cancel-sign-sub-inv31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0599999999999999e244 < y < -6.19999999999999965e112

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{z \cdot 2} \cdot y} \]
      4. distribute-lft-neg-out45.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 55.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+242}:\\
\;\;\;\;\sqrt{z} \cdot \left(y \cdot \left(-\sqrt{2}\right)\right)\\

\mathbf{elif}\;y \leq -5.1 \cdot 10^{+110}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {y}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.7e242

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -3.7e242 < y < -5.1000000000000002e110

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{z \cdot 2} \cdot y} \]
      4. distribute-lft-neg-out45.4%

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

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

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

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

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

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

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

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

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

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

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

    if -5.1000000000000002e110 < y

    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.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*58.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 55.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq -4.5 \cdot 10^{+111}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {y}^{2}}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.0599999999999999e244

    1. Initial program 99.9%

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

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

    if -1.0599999999999999e244 < y < -4.50000000000000001e111

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{z \cdot 2} \cdot y} \]
      4. distribute-lft-neg-out45.4%

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000001e111 < y

    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.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*58.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 42.6% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.00000000000000015e-43 or 1.8999999999999999e28 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000015e-43 < y < 1.8999999999999999e28

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5\right) \cdot \sqrt{z \cdot 2} - \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
      11. cancel-sign-sub-inv45.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, -\sqrt{z \cdot 2}, 0.5 \cdot \left(x \cdot \sqrt{z \cdot 2}\right)\right)} \]
      4. add-sqr-sqrt0.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \sqrt{z \cdot 2}, \color{blue}{\left(x \cdot 0.5\right)} \cdot \sqrt{z \cdot 2}\right) \]
    7. Applied egg-rr45.9%

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

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

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

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

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

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

Alternative 7: 56.5% 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.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.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5\right) \cdot \sqrt{z \cdot 2} - \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
    11. cancel-sign-sub-inv28.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 29.8% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 2.6% accurate, 215.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x y z t) :precision binary64 0.0)
double code(double x, double y, double z, double t) {
	return 0.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 = 0.0d0
end function
public static double code(double x, double y, double z, double t) {
	return 0.0;
}
def code(x, y, z, t):
	return 0.0
function code(x, y, z, t)
	return 0.0
end
function tmp = code(x, y, z, t)
	tmp = 0.0;
end
code[x_, y_, z_, t_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  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.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5\right) \cdot \sqrt{z \cdot 2} - \color{blue}{\sqrt{z \cdot 2} \cdot \left(-y\right)} \]
    11. cancel-sign-sub-inv28.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{0} \]
  9. Final simplification3.1%

    \[\leadsto 0 \]
  10. Add Preprocessing

Developer target: 99.4% accurate, 0.7× speedup?

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

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

Reproduce

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