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

Percentage Accurate: 99.6% → 99.8%
Time: 11.7s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

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

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot e^{t \cdot t}\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. expm1-log1p-u98.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 86.1% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 2) < 9.99999999999999967e117

    1. Initial program 99.2%

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

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

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

      \[\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)} \]

    if 9.99999999999999967e117 < (*.f64 z 2)

    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. Step-by-step derivation
      1. associate-*l*99.9%

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

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

      \[\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. expm1-log1p-u96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 58.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 27.5:\\
\;\;\;\;t_1 \cdot \sqrt{z \cdot 2}\\

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


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

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

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

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

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

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

    if 27.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. 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 15.1%

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

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

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

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

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

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

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

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

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

        \[\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)} \]
      10. pow223.6%

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

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

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

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

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

Alternative 4: 85.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \left(0.5 \cdot \left(t \cdot t\right) + 1\right)\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(x * 0.5) - y) * Float64(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[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \left(0.5 \cdot \left(t \cdot t\right) + 1\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 83.5%

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

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

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

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

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

Alternative 5: 83.7% accurate, 1.9× speedup?

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

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + z \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. expm1-log1p-u98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 55.8% accurate, 1.9× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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)} \]
      10. pow284.7%

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

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

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

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

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

    if -9.5e229 < y

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

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

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

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

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

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

Alternative 7: 42.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-48} \lor \neg \left(y \leq 7.4 \cdot 10^{+36}\right):\\ \;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -2.4e-48) (not (<= y 7.4e+36)))
   (* y (- (sqrt (* z 2.0))))
   (* x (sqrt (* 0.5 z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.4e-48) || !(y <= 7.4e+36)) {
		tmp = y * -sqrt((z * 2.0));
	} 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 <= (-2.4d-48)) .or. (.not. (y <= 7.4d+36))) then
        tmp = y * -sqrt((z * 2.0d0))
    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 <= -2.4e-48) || !(y <= 7.4e+36)) {
		tmp = y * -Math.sqrt((z * 2.0));
	} else {
		tmp = x * Math.sqrt((0.5 * z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -2.4e-48) or not (y <= 7.4e+36):
		tmp = y * -math.sqrt((z * 2.0))
	else:
		tmp = x * math.sqrt((0.5 * z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -2.4e-48) || !(y <= 7.4e+36))
		tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0))));
	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 <= -2.4e-48) || ~((y <= 7.4e+36)))
		tmp = y * -sqrt((z * 2.0));
	else
		tmp = x * sqrt((0.5 * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.4e-48], N[Not[LessEqual[y, 7.4e+36]], $MachinePrecision]], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-48} \lor \neg \left(y \leq 7.4 \cdot 10^{+36}\right):\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.4e-48 or 7.40000000000000058e36 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4e-48 < y < 7.40000000000000058e36

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)} \]
      9. *-commutative23.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)} \]
      10. pow223.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{0.5 \cdot z} \cdot \sqrt{x \cdot x}} \]
      3. *-commutative24.2%

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

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

        \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
    11. Applied egg-rr43.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-48} \lor \neg \left(y \leq 7.4 \cdot 10^{+36}\right):\\ \;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \end{array} \]

Alternative 8: 43.2% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;y \leq 3.3 \cdot 10^{+38}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.20000000000000003e-47

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\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)} \]
      10. pow260.2%

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

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

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

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

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

    if -8.20000000000000003e-47 < y < 3.2999999999999999e38

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot z\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(x \cdot 0.5 - y\right)\right)} \]
      9. *-commutative23.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)} \]
      10. pow223.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{0.5 \cdot z} \cdot \sqrt{x \cdot x}} \]
      3. *-commutative24.2%

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

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

        \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
    11. Applied egg-rr43.2%

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

    if 3.2999999999999999e38 < y

    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. Step-by-step derivation
      1. associate-*l*99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 29.8% 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 56.6%

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. pow231.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{0.5 \cdot z} \cdot \sqrt{x \cdot x}} \]
    3. *-commutative17.1%

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

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

      \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
  11. Applied egg-rr26.2%

    \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot x} \]
  12. Final simplification26.2%

    \[\leadsto x \cdot \sqrt{0.5 \cdot z} \]

Developer target: 99.5% accurate, 0.7× speedup?

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

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

Reproduce

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