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

Percentage Accurate: 99.4% → 99.7%
Time: 18.1s
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.7% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 59.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999996e-5 < t

    1. Initial program 98.4%

      \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt48.4%

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

        \[\leadsto \color{blue}{\sqrt{\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)}} \cdot e^{\frac{t \cdot t}{2}} \]
      3. *-commutative46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x \cdot 0.5 - y\right) \cdot {\left(2 \cdot z\right)}^{0.25}\right) \cdot {\left(2 \cdot z\right)}^{\color{blue}{0.25}}\right) \cdot e^{\frac{t \cdot t}{2}} \]
    8. Applied egg-rr98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 58.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.22e30 < t

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.4% accurate, 1.0× speedup?

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

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

Alternative 5: 31.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 39000000:\\
\;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\sqrt{\color{blue}{y \cdot y}} \cdot \sqrt{2 \cdot z} \]
      14. sqrt-unprod21.2%

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

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

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

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

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

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

    if 3.9e7 < t

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 56.4% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 30.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\sqrt{\color{blue}{y \cdot y}} \cdot \sqrt{2 \cdot z} \]
    14. sqrt-unprod17.0%

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

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

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

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

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

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

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

Alternative 8: 2.6% accurate, 2.0× speedup?

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

\\
y \cdot \sqrt{2 \cdot z}
\end{array}
Derivation
  1. Initial program 99.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 57.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 30.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \sqrt{2 \cdot z}} \]
    2. *-commutative1.9%

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

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

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

Developer target: 99.4% accurate, 0.7× speedup?

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

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

Reproduce

?
herbie shell --seed 2024055 
(FPCore (x y z t)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
  :precision binary64

  :alt
  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))

  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))