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

Percentage Accurate: 99.4% → 99.8%
Time: 13.3s
Alternatives: 8
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 8 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 5e17 or 9.99999999999999945e193 < (*.f64 t t)

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \left(\frac{\color{blue}{t \cdot t}}{2} + 1\right)\right) \]
      5. associate-/l*95.5%

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

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

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

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

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

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

    if 5e17 < (*.f64 t t) < 9.99999999999999945e193

    1. Initial program 97.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. add-cbrt-cube87.2%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\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)\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right)}} \cdot e^{\frac{t \cdot t}{2}} \]
      2. pow387.2%

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

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

      \[\leadsto \color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(x, 0.5, -y\right) \cdot \sqrt{z \cdot 2}\right)}^{3}}} \cdot e^{\frac{t \cdot t}{2}} \]
    4. Step-by-step derivation
      1. rem-cbrt-cube97.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(2 \cdot z\right)}^{\color{blue}{0.25}} \cdot \left(\sqrt{\sqrt{z \cdot 2}} \cdot \left(x \cdot 0.5 - y\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. pow1/297.4%

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

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

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

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

        \[\leadsto \left({\left(2 \cdot z\right)}^{0.25} \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(\color{blue}{0.5 \cdot x} - y\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      15. fma-neg97.4%

        \[\leadsto \left({\left(2 \cdot z\right)}^{0.25} \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{\mathsf{fma}\left(0.5, x, -y\right)}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      16. add-sqr-sqrt59.0%

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

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

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

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

        \[\leadsto \left({\left(2 \cdot z\right)}^{0.25} \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \mathsf{fma}\left(0.5, x, \color{blue}{y}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
    5. Applied egg-rr51.3%

      \[\leadsto \color{blue}{\left({\left(2 \cdot z\right)}^{0.25} \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \mathsf{fma}\left(0.5, x, y\right)\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    6. Taylor expanded in x around inf 82.1%

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

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

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

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

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

      \[\leadsto \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{\left({\left(z \cdot 2\right)}^{0.25} \cdot \left(0.5 \cdot x\right)\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u59.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(2 \cdot z\right)}^{0.25} \cdot \left({\left(z \cdot 2\right)}^{0.25} \cdot \left(0.5 \cdot x\right)\right)\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
      2. expm1-udef30.8%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({\left(2 \cdot z\right)}^{0.25} \cdot \left({\left(z \cdot 2\right)}^{0.25} \cdot \left(0.5 \cdot x\right)\right)\right)} - 1\right)} \cdot e^{\frac{t \cdot t}{2}} \]
      3. associate-*r*30.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\left({\left(2 \cdot z\right)}^{0.25} \cdot {\left(z \cdot 2\right)}^{0.25}\right) \cdot \left(0.5 \cdot x\right)}\right)} - 1\right) \cdot e^{\frac{t \cdot t}{2}} \]
      4. *-commutative30.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\left({\color{blue}{\left(z \cdot 2\right)}}^{0.25} \cdot {\left(z \cdot 2\right)}^{0.25}\right) \cdot \left(0.5 \cdot x\right)\right)} - 1\right) \cdot e^{\frac{t \cdot t}{2}} \]
      5. pow-prod-up30.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{{\left(z \cdot 2\right)}^{\left(0.25 + 0.25\right)}} \cdot \left(0.5 \cdot x\right)\right)} - 1\right) \cdot e^{\frac{t \cdot t}{2}} \]
      6. metadata-eval30.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left({\left(z \cdot 2\right)}^{\color{blue}{0.5}} \cdot \left(0.5 \cdot x\right)\right)} - 1\right) \cdot e^{\frac{t \cdot t}{2}} \]
      7. pow1/230.8%

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

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \left(0.5 \cdot x\right)\right)} - 1\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    11. Step-by-step derivation
      1. expm1-def59.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot t \leq 5 \cdot 10^{+17} \lor \neg \left(t \cdot t \leq 10^{+194}\right):\\ \;\;\;\;\left(0.5 \cdot x - y\right) \cdot \left(\sqrt{2 \cdot z} \cdot \left(t \cdot \left(t \cdot 0.5\right) + 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\left(0.5 \cdot x\right) \cdot \sqrt{2 \cdot z}\right)\\ \end{array} \]

Alternative 3: 99.4% accurate, 1.0× speedup?

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

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

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

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

Alternative 4: 86.1% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \left(\frac{\color{blue}{t \cdot t}}{2} + 1\right)\right) \]
    5. associate-/l*85.4%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{t}{\frac{2}{t}}} + 1\right)\right) \]
  8. Applied egg-rr85.4%

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

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

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

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

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

    \[\leadsto \left(0.5 \cdot x - y\right) \cdot \left(\sqrt{2 \cdot z} \cdot \left(t \cdot \left(t \cdot 0.5\right) + 1\right)\right) \]

Alternative 5: 58.2% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.65e15 < t

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{z} \cdot \sqrt{2 \cdot {\left(\mathsf{fma}\left(0.5, x, \color{blue}{\sqrt{-y} \cdot \sqrt{-y}}\right)\right)}^{2}} \]
      11. sqrt-unprod31.7%

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

        \[\leadsto \sqrt{z} \cdot \sqrt{2 \cdot {\left(\mathsf{fma}\left(0.5, x, \sqrt{\color{blue}{y \cdot y}}\right)\right)}^{2}} \]
      13. sqrt-unprod6.4%

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

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

      \[\leadsto \sqrt{z} \cdot \color{blue}{\sqrt{2 \cdot {\left(\mathsf{fma}\left(0.5, x, y\right)\right)}^{2}}} \]
    5. Taylor expanded in x around 0 11.6%

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

        \[\leadsto \sqrt{z} \cdot \sqrt{2 \cdot \color{blue}{\left({y}^{2} + x \cdot y\right)}} \]
      2. unpow211.6%

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot \left(2 \cdot \left(y \cdot \left(y + x\right)\right)\right)}} \]
      2. pow1/219.3%

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

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

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

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

Alternative 6: 16.5% accurate, 2.0× speedup?

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

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

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. 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)} \]
  3. Step-by-step derivation
    1. add-sqr-sqrt27.6%

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{z} \cdot \sqrt{2 \cdot {\color{blue}{\left(\mathsf{fma}\left(0.5, x, -y\right)\right)}}^{2}} \]
    10. add-sqr-sqrt22.1%

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

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

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

      \[\leadsto \sqrt{z} \cdot \sqrt{2 \cdot {\left(\mathsf{fma}\left(0.5, x, \color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)\right)}^{2}} \]
    14. add-sqr-sqrt28.1%

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

    \[\leadsto \sqrt{z} \cdot \color{blue}{\sqrt{2 \cdot {\left(\mathsf{fma}\left(0.5, x, y\right)\right)}^{2}}} \]
  5. Taylor expanded in x around 0 15.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z} \cdot \sqrt{2 \cdot \left(y \cdot \left(y + x\right)\right)}\right)\right)} \]
    2. expm1-udef15.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{z} \cdot \sqrt{2 \cdot \left(y \cdot \left(y + x\right)\right)}\right)} - 1} \]
    3. sqrt-unprod15.2%

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

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{z \cdot \left(2 \cdot \left(y \cdot \color{blue}{\left(x + y\right)}\right)\right)}\right)} - 1 \]
  9. Applied egg-rr15.2%

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

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{z \cdot \left(2 \cdot \left(y \cdot \left(x + y\right)\right)\right)}\right)\right)} \]
    2. expm1-log1p17.1%

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

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

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

    \[\leadsto \color{blue}{\sqrt{\left(z \cdot 2\right) \cdot \left(y \cdot \left(y + x\right)\right)}} \]
  12. Final simplification17.1%

    \[\leadsto \sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(x + y\right)\right)} \]

Alternative 7: 57.6% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 2.5% accurate, 2.0× speedup?

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

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

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. 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)} \]
  3. Step-by-step derivation
    1. *-commutative58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{z} \cdot \left(-y\right)\right)\right)} - 1} \]
    3. associate-*r*13.9%

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

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{2 \cdot z}} \cdot \left(-y\right)\right)} - 1 \]
    5. *-commutative13.9%

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

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

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)} - 1 \]
    8. sqr-neg15.7%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{z \cdot 2} \cdot \sqrt{\color{blue}{y \cdot y}}\right)} - 1 \]
    9. sqrt-unprod1.7%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{z \cdot 2} \cdot y} \]
    3. *-commutative2.5%

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

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

    \[\leadsto y \cdot \sqrt{2 \cdot z} \]

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 2023320 
(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))))