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

Percentage Accurate: 99.4% → 99.8%
Time: 10.4s
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, 1.0× speedup?

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    2. 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. Step-by-step derivation
    1. add-exp-log99.8%

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

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

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

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

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

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

Alternative 2: 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}
Derivation
  1. Initial program 99.4%

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

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

Alternative 3: 85.9% accurate, 1.8× speedup?

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

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

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

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

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

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

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

Alternative 4: 86.7% accurate, 1.8× speedup?

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]
    2. 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. Step-by-step derivation
    1. add-exp-log99.8%

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

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

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

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

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{e^{0.5 \cdot \left(t \cdot t\right)}}\right) \]
  6. Taylor expanded in t around 0 89.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) \]
  7. Step-by-step derivation
    1. unpow289.4%

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

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

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

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

Alternative 5: 32.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0038:\\
\;\;\;\;\sqrt{z \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\


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

    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-*l*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(z \cdot \color{blue}{0.25}\right) \cdot \left(\left(\sqrt{2} \cdot x\right) \cdot \left(\sqrt{2} \cdot x\right)\right)} \]
      9. swap-sqr23.1%

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

        \[\leadsto \sqrt{\left(z \cdot 0.25\right) \cdot \left(\color{blue}{2} \cdot \left(x \cdot x\right)\right)} \]
    9. Applied egg-rr23.1%

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

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

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

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

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

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

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

    if -0.00379999999999999999 < t

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(z \cdot 0.25\right) \cdot \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)\right)}} \]
      10. add-sqr-sqrt15.7%

        \[\leadsto \sqrt{\left(z \cdot 0.25\right) \cdot \left(\color{blue}{2} \cdot \left(x \cdot x\right)\right)} \]
    9. Applied egg-rr15.7%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      3. sqrt-prod18.9%

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

        \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
    13. Applied egg-rr44.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0038:\\ \;\;\;\;\sqrt{z \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \end{array} \]

Alternative 6: 37.7% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.54999999999999996e94

    1. Initial program 99.9%

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

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

        \[\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 1 \]
      2. sqrt-unprod69.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 1 \]
      3. *-commutative69.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 1 \]
      4. *-commutative69.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 1 \]
      5. swap-sqr67.4%

        \[\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 1 \]
      6. add-sqr-sqrt67.4%

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

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

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

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

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

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

    if -1.54999999999999996e94 < y

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(z \cdot \color{blue}{0.25}\right) \cdot \left(\left(\sqrt{2} \cdot x\right) \cdot \left(\sqrt{2} \cdot x\right)\right)} \]
      9. swap-sqr16.0%

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

        \[\leadsto \sqrt{\left(z \cdot 0.25\right) \cdot \left(\color{blue}{2} \cdot \left(x \cdot x\right)\right)} \]
    9. Applied egg-rr16.0%

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

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

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

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

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

        \[\leadsto \sqrt{z \cdot \left(0.5 \cdot \color{blue}{\left(x \cdot x\right)}\right)} \]
    11. Simplified16.0%

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      3. sqrt-prod15.4%

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

        \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
    13. Applied egg-rr36.4%

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

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

Alternative 7: 57.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

Alternative 8: 30.2% accurate, 2.0× speedup?

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

\\
x \cdot \sqrt{0.5 \cdot z}
\end{array}
Derivation
  1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
    3. sqrt-prod15.4%

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

      \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
  13. Applied egg-rr34.3%

    \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot x} \]
  14. Final simplification34.3%

    \[\leadsto x \cdot \sqrt{0.5 \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 2023192 
(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))))