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

Percentage Accurate: 99.5% → 99.8%
Time: 12.9s
Alternatives: 11
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 11 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.5% 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{2 \cdot \left(z \cdot e^{t \cdot t}\right)} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (- (* x 0.5) y) (sqrt (* 2.0 (* z (exp (* t t)))))))
double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * sqrt((2.0 * (z * 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((2.0d0 * (z * exp((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 * Math.exp((t * t)))));
}
def code(x, y, z, t):
	return ((x * 0.5) - y) * math.sqrt((2.0 * (z * math.exp((t * t)))))
function code(x, y, z, t)
	return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * Float64(z * exp(Float64(t * t))))))
end
function tmp = code(x, y, z, t)
	tmp = ((x * 0.5) - y) * sqrt((2.0 * (z * exp((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[Exp[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 \cdot e^{t \cdot t}\right)}
\end{array}
Derivation
  1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 0.0145 \lor \neg \left(t \cdot t \leq 1.58 \cdot 10^{+308}\right):\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \left(t \cdot t + 1\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 0.0145000000000000007 or 1.5799999999999999e308 < (*.f64 t t)

    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.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. Step-by-step derivation
      1. expm1-log1p-u98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0145000000000000007 < (*.f64 t t) < 1.5799999999999999e308

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{y \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      4. unpow1/273.7%

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

        \[\leadsto \left(-y \cdot \left({2}^{\color{blue}{\left(2 \cdot 0.25\right)}} \cdot \sqrt{z}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      6. pow-sqr73.7%

        \[\leadsto \left(-y \cdot \left(\color{blue}{\left({2}^{0.25} \cdot {2}^{0.25}\right)} \cdot \sqrt{z}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      7. unpow1/273.7%

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

        \[\leadsto \left(-y \cdot \left(\left({2}^{0.25} \cdot {2}^{0.25}\right) \cdot {z}^{\color{blue}{\left(2 \cdot 0.25\right)}}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      9. pow-sqr73.7%

        \[\leadsto \left(-y \cdot \left(\left({2}^{0.25} \cdot {2}^{0.25}\right) \cdot \color{blue}{\left({z}^{0.25} \cdot {z}^{0.25}\right)}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      10. swap-sqr73.7%

        \[\leadsto \left(-y \cdot \color{blue}{\left(\left({2}^{0.25} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)}\right) \cdot e^{\frac{t \cdot t}{2}} \]
      11. exp-to-pow73.7%

        \[\leadsto \left(-y \cdot \left(\left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      12. exp-to-pow73.6%

        \[\leadsto \left(-y \cdot \left(\left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      13. exp-sum73.6%

        \[\leadsto \left(-y \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      14. distribute-rgt-in73.6%

        \[\leadsto \left(-y \cdot \left(e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      15. log-prod73.6%

        \[\leadsto \left(-y \cdot \left(e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      16. log-pow73.6%

        \[\leadsto \left(-y \cdot \left(e^{\color{blue}{\log \left({\left(2 \cdot z\right)}^{0.25}\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      17. rem-exp-log73.7%

        \[\leadsto \left(-y \cdot \left(\color{blue}{{\left(2 \cdot z\right)}^{0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      18. exp-to-pow73.7%

        \[\leadsto \left(-y \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      19. exp-to-pow73.6%

        \[\leadsto \left(-y \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
      20. exp-sum73.6%

        \[\leadsto \left(-y \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}}\right)\right) \cdot e^{\frac{t \cdot t}{2}} \]
    8. Simplified73.7%

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

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

Alternative 3: 65.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq -1.2 \cdot 10^{+26} \lor \neg \left(t \leq 310000000\right):\\ \;\;\;\;t_1 \cdot {\left(4 \cdot \left(z \cdot z\right)\right)}^{0.25}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sqrt{2 \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (or (<= t -1.2e+26) (not (<= t 310000000.0)))
     (* t_1 (pow (* 4.0 (* z z)) 0.25))
     (* t_1 (sqrt (* 2.0 z))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if ((t <= -1.2e+26) || !(t <= 310000000.0)) {
		tmp = t_1 * pow((4.0 * (z * z)), 0.25);
	} else {
		tmp = t_1 * sqrt((2.0 * 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) :: t_1
    real(8) :: tmp
    t_1 = (x * 0.5d0) - y
    if ((t <= (-1.2d+26)) .or. (.not. (t <= 310000000.0d0))) then
        tmp = t_1 * ((4.0d0 * (z * z)) ** 0.25d0)
    else
        tmp = t_1 * sqrt((2.0d0 * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if ((t <= -1.2e+26) || !(t <= 310000000.0)) {
		tmp = t_1 * Math.pow((4.0 * (z * z)), 0.25);
	} else {
		tmp = t_1 * Math.sqrt((2.0 * z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * 0.5) - y
	tmp = 0
	if (t <= -1.2e+26) or not (t <= 310000000.0):
		tmp = t_1 * math.pow((4.0 * (z * z)), 0.25)
	else:
		tmp = t_1 * math.sqrt((2.0 * z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if ((t <= -1.2e+26) || !(t <= 310000000.0))
		tmp = Float64(t_1 * (Float64(4.0 * Float64(z * z)) ^ 0.25));
	else
		tmp = Float64(t_1 * sqrt(Float64(2.0 * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * 0.5) - y;
	tmp = 0.0;
	if ((t <= -1.2e+26) || ~((t <= 310000000.0)))
		tmp = t_1 * ((4.0 * (z * z)) ^ 0.25);
	else
		tmp = t_1 * sqrt((2.0 * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[Or[LessEqual[t, -1.2e+26], N[Not[LessEqual[t, 310000000.0]], $MachinePrecision]], N[(t$95$1 * N[Power[N[(4.0 * N[(z * z), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{+26} \lor \neg \left(t \leq 310000000\right):\\
\;\;\;\;t_1 \cdot {\left(4 \cdot \left(z \cdot z\right)\right)}^{0.25}\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sqrt{2 \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.20000000000000002e26 or 3.1e8 < t

    1. Initial program 98.2%

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(z \cdot 2\right)}^{\color{blue}{\left(0.25 + 0.25\right)}} \]
      5. pow-prod-up20.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left({\left(z \cdot 2\right)}^{0.25} \cdot {\left(z \cdot 2\right)}^{0.25}\right)} \]
      6. pow-prod-down40.6%

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(\left(2 \cdot 2\right) \cdot \left(z \cdot z\right)\right)}}^{0.25} \]
      10. metadata-eval40.6%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(4 \cdot \left(z \cdot z\right)\right)}^{0.25}} \]

    if -1.20000000000000002e26 < t < 3.1e8

    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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{\left({2}^{0.25} \cdot {2}^{0.25}\right)} \cdot \sqrt{z}\right) \]
      4. unpow1/294.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left({2}^{0.25} \cdot {2}^{0.25}\right) \cdot \color{blue}{{z}^{0.5}}\right) \]
      5. metadata-eval94.9%

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left({2}^{0.25} \cdot {2}^{0.25}\right) \cdot \color{blue}{\left({z}^{0.25} \cdot {z}^{0.25}\right)}\right) \]
      7. swap-sqr94.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\left({2}^{0.25} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)} \]
      8. exp-to-pow94.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      9. exp-to-pow90.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      10. exp-sum90.2%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      11. distribute-rgt-in90.2%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      12. log-prod90.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      13. *-commutative90.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      14. exp-to-pow94.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{{\left(2 \cdot z\right)}^{0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      15. exp-to-pow94.9%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right)\right) \]
      16. exp-to-pow90.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right)\right) \]
      17. exp-sum90.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}}\right) \]
      18. distribute-rgt-in90.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}}\right) \]
      19. log-prod90.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}}\right) \]
      20. *-commutative90.6%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}}\right) \]
      21. exp-to-pow94.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+26} \lor \neg \left(t \leq 310000000\right):\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot {\left(4 \cdot \left(z \cdot z\right)\right)}^{0.25}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\ \end{array} \]

Alternative 4: 84.4% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 45.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \sqrt{0.5 \cdot z}\\
\mathbf{if}\;x \leq -86000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-65}:\\
\;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+221}:\\
\;\;\;\;\sqrt{\left(x \cdot 0.5\right) \cdot \left(x \cdot z\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.6e7 or 1.1e221 < x

    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. Taylor expanded in t around 0 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.6e7 < x < 5.4999999999999999e-65

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{2 \cdot z} \cdot y} \]

    if 5.4999999999999999e-65 < x < 1.1e221

    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. Taylor expanded in t around 0 53.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\left(z \cdot 0.5\right) \cdot \left(x \cdot x\right)}} \]
    12. Taylor expanded in z around 0 57.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -86000000:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-65}:\\ \;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{+221}:\\ \;\;\;\;\sqrt{\left(x \cdot 0.5\right) \cdot \left(x \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \end{array} \]

Alternative 6: 45.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \sqrt{0.5 \cdot z}\\
\mathbf{if}\;x \leq -40000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 4 \cdot 10^{-62}:\\
\;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\

\mathbf{elif}\;x \leq 2 \cdot 10^{+213}:\\
\;\;\;\;\sqrt{\left(0.5 \cdot z\right) \cdot \left(x \cdot x\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4e7 or 1.99999999999999997e213 < x

    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. Taylor expanded in t around 0 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      2. sqrt-prod17.6%

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

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

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

    if -4e7 < x < 4.0000000000000002e-62

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{2 \cdot z} \cdot y} \]

    if 4.0000000000000002e-62 < x < 1.99999999999999997e213

    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. Taylor expanded in t around 0 53.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 44.3% accurate, 1.9× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.00000000000000008e140 or 4.5000000000000003e110 < 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. Taylor expanded in t around 0 73.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{2 \cdot z} \cdot y} \]

    if -5.00000000000000008e140 < y < -9.50000000000000044e-43

    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. Taylor expanded in t around 0 53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.50000000000000044e-43 < y < 4.5000000000000003e110

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      2. sqrt-prod24.6%

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

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

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

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

Alternative 8: 43.9% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.50000000000000044e-43 or 3.09999999999999983e112 < 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. Taylor expanded in t around 0 66.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{2 \cdot z} \cdot y} \]

    if -9.50000000000000044e-43 < y < 3.09999999999999983e112

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      2. sqrt-prod24.6%

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

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

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

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

Alternative 9: 58.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{\left({2}^{0.25} \cdot {2}^{0.25}\right)} \cdot \sqrt{z}\right) \]
    4. unpow1/263.0%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left({2}^{0.25} \cdot {2}^{0.25}\right) \cdot \color{blue}{{z}^{0.5}}\right) \]
    5. metadata-eval63.0%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left({2}^{0.25} \cdot {2}^{0.25}\right) \cdot {z}^{\color{blue}{\left(2 \cdot 0.25\right)}}\right) \]
    6. pow-sqr63.0%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\left({2}^{0.25} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)} \]
    8. exp-to-pow62.9%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
    9. exp-to-pow60.5%

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
    11. distribute-rgt-in60.4%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
    12. log-prod60.6%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
    13. *-commutative60.6%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
    14. exp-to-pow63.0%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{{\left(2 \cdot z\right)}^{0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
    15. exp-to-pow63.0%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right)\right) \]
    16. exp-to-pow60.5%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right)\right) \]
    17. exp-sum60.4%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}}\right) \]
    18. distribute-rgt-in60.4%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}}\right) \]
    19. log-prod60.6%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}}\right) \]
    20. *-commutative60.6%

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}}\right) \]
    21. exp-to-pow63.0%

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

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

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

Alternative 10: 2.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 30.6% 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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 2023196 
(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))))