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

Percentage Accurate: 99.5% → 99.8%
Time: 18.6s
Alternatives: 13
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 13 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, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{2 \cdot z}\\ t_2 := 0.5 \cdot x - y\\ \mathbf{if}\;t \cdot t \leq 5000000000000:\\ \;\;\;\;t\_2 \cdot \left(t\_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\ \mathbf{elif}\;t \cdot t \leq 10^{+146}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\left(0.5 \cdot x\right) \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* 2.0 z))) (t_2 (- (* 0.5 x) y)))
   (if (<= (* t t) 5000000000000.0)
     (* t_2 (* t_1 (hypot 1.0 t)))
     (if (<= (* t t) 1e+146)
       (* (exp (/ (* t t) 2.0)) (* (* 0.5 x) t_1))
       (* t_2 (sqrt (* 2.0 (* z (pow t 2.0)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((2.0 * z));
	double t_2 = (0.5 * x) - y;
	double tmp;
	if ((t * t) <= 5000000000000.0) {
		tmp = t_2 * (t_1 * hypot(1.0, t));
	} else if ((t * t) <= 1e+146) {
		tmp = exp(((t * t) / 2.0)) * ((0.5 * x) * t_1);
	} else {
		tmp = t_2 * sqrt((2.0 * (z * pow(t, 2.0))));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((2.0 * z));
	double t_2 = (0.5 * x) - y;
	double tmp;
	if ((t * t) <= 5000000000000.0) {
		tmp = t_2 * (t_1 * Math.hypot(1.0, t));
	} else if ((t * t) <= 1e+146) {
		tmp = Math.exp(((t * t) / 2.0)) * ((0.5 * x) * t_1);
	} else {
		tmp = t_2 * Math.sqrt((2.0 * (z * Math.pow(t, 2.0))));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.sqrt((2.0 * z))
	t_2 = (0.5 * x) - y
	tmp = 0
	if (t * t) <= 5000000000000.0:
		tmp = t_2 * (t_1 * math.hypot(1.0, t))
	elif (t * t) <= 1e+146:
		tmp = math.exp(((t * t) / 2.0)) * ((0.5 * x) * t_1)
	else:
		tmp = t_2 * math.sqrt((2.0 * (z * math.pow(t, 2.0))))
	return tmp
function code(x, y, z, t)
	t_1 = sqrt(Float64(2.0 * z))
	t_2 = Float64(Float64(0.5 * x) - y)
	tmp = 0.0
	if (Float64(t * t) <= 5000000000000.0)
		tmp = Float64(t_2 * Float64(t_1 * hypot(1.0, t)));
	elseif (Float64(t * t) <= 1e+146)
		tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(0.5 * x) * t_1));
	else
		tmp = Float64(t_2 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((2.0 * z));
	t_2 = (0.5 * x) - y;
	tmp = 0.0;
	if ((t * t) <= 5000000000000.0)
		tmp = t_2 * (t_1 * hypot(1.0, t));
	elseif ((t * t) <= 1e+146)
		tmp = exp(((t * t) / 2.0)) * ((0.5 * x) * t_1);
	else
		tmp = t_2 * sqrt((2.0 * (z * (t ^ 2.0))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5000000000000.0], N[(t$95$2 * N[(t$95$1 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+146], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
t_2 := 0.5 \cdot x - y\\
\mathbf{if}\;t \cdot t \leq 5000000000000:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\

\mathbf{elif}\;t \cdot t \leq 10^{+146}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\left(0.5 \cdot x\right) \cdot t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 t t) < 5e12

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}} \]
    12. Step-by-step derivation
      1. associate-*r*99.5%

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \color{blue}{\left(\sqrt{2 \cdot z} \cdot \sqrt{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    14. Step-by-step derivation
      1. *-commutative99.4%

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot x - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\mathsf{hypot}\left(1, t\right)}\right) \]
    15. Simplified99.4%

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

    if 5e12 < (*.f64 t t) < 9.99999999999999934e145

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999934e145 < (*.f64 t t)

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}} \]
    12. Taylor expanded in t around inf 89.7%

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

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

Alternative 3: 89.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.5 \cdot x - y\\ \mathbf{if}\;t \cdot t \leq 5000000000000:\\ \;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\ \mathbf{elif}\;t \cdot t \leq 10^{+146}:\\ \;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\left(0.5 \cdot x\right) \cdot \sqrt{2 \cdot z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* 0.5 x) y)))
   (if (<= (* t t) 5000000000000.0)
     (* t_1 (sqrt (* 2.0 (* z (fma t t 1.0)))))
     (if (<= (* t t) 1e+146)
       (* (exp (/ (* t t) 2.0)) (* (* 0.5 x) (sqrt (* 2.0 z))))
       (* t_1 (sqrt (* 2.0 (* z (pow t 2.0)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (0.5 * x) - y;
	double tmp;
	if ((t * t) <= 5000000000000.0) {
		tmp = t_1 * sqrt((2.0 * (z * fma(t, t, 1.0))));
	} else if ((t * t) <= 1e+146) {
		tmp = exp(((t * t) / 2.0)) * ((0.5 * x) * sqrt((2.0 * z)));
	} else {
		tmp = t_1 * sqrt((2.0 * (z * pow(t, 2.0))));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(0.5 * x) - y)
	tmp = 0.0
	if (Float64(t * t) <= 5000000000000.0)
		tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z * fma(t, t, 1.0)))));
	elseif (Float64(t * t) <= 1e+146)
		tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(0.5 * x) * sqrt(Float64(2.0 * z))));
	else
		tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0)))));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5000000000000.0], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+146], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 0.5 \cdot x - y\\
\mathbf{if}\;t \cdot t \leq 5000000000000:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 t t) < 5e12

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e12 < (*.f64 t t) < 9.99999999999999934e145

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999934e145 < (*.f64 t t)

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}} \]
    12. Taylor expanded in t around inf 89.7%

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

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

Alternative 4: 70.9% accurate, 1.0× speedup?

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

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

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 1 < t

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}} \]
    12. Taylor expanded in t around inf 79.5%

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

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

Alternative 5: 78.8% accurate, 1.0× speedup?

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

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

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


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

    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. *-commutative99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}} \]
    12. Step-by-step derivation
      1. associate-*r*90.7%

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \color{blue}{\left(\sqrt{2 \cdot z} \cdot \sqrt{\mathsf{fma}\left(t, t, 1\right)}\right)} \]
    14. Step-by-step derivation
      1. *-commutative88.9%

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot x - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\mathsf{hypot}\left(1, t\right)}\right) \]
    15. Simplified82.0%

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

    if 3.2e47 < t

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}} \]
    12. Taylor expanded in t around inf 83.5%

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

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

Alternative 6: 66.7% accurate, 1.0× speedup?

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

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

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 1 < t

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}} \]
    12. Taylor expanded in t around inf 52.3%

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

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

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

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

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

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

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

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

Alternative 7: 59.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.5 \cdot x - y\\ \mathbf{if}\;t \leq 3.2:\\ \;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* 0.5 x) y)))
   (if (<= t 3.2)
     (* t_1 (sqrt (* 2.0 z)))
     (* t_1 (cbrt (pow (* 2.0 z) 1.5))))))
double code(double x, double y, double z, double t) {
	double t_1 = (0.5 * x) - y;
	double tmp;
	if (t <= 3.2) {
		tmp = t_1 * sqrt((2.0 * z));
	} else {
		tmp = t_1 * cbrt(pow((2.0 * z), 1.5));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (0.5 * x) - y;
	double tmp;
	if (t <= 3.2) {
		tmp = t_1 * Math.sqrt((2.0 * z));
	} else {
		tmp = t_1 * Math.cbrt(Math.pow((2.0 * z), 1.5));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(0.5 * x) - y)
	tmp = 0.0
	if (t <= 3.2)
		tmp = Float64(t_1 * sqrt(Float64(2.0 * z)));
	else
		tmp = Float64(t_1 * cbrt((Float64(2.0 * z) ^ 1.5)));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 3.2], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 3.2000000000000002 < t

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot x - y\right) \cdot {\left(\color{blue}{{\left(z \cdot 2\right)}^{1}} \cdot \sqrt{z \cdot 2}\right)}^{0.3333333333333333} \]
      11. pow1/224.5%

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \color{blue}{{\left({\left(2 \cdot z\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    10. Step-by-step derivation
      1. unpow1/324.5%

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

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

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

Alternative 8: 99.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 9: 57.6% accurate, 1.0× speedup?

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

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

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 1.49999999999999989e136 < t

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\left(\sqrt{\sqrt{z \cdot 2} \cdot \mathsf{fma}\left(x, 0.5, -y\right)}\right)}^{2}\right)}^{\color{blue}{\left(0.5 + 0.5\right)}} \]
      8. pow-prod-up5.9%

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

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

      \[\leadsto \color{blue}{{\left(\left(2 \cdot z\right) \cdot {\left(\mathsf{fma}\left(0.5, x, y\right)\right)}^{2}\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/235.0%

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

        \[\leadsto \sqrt{\color{blue}{{\left(\mathsf{fma}\left(0.5, x, y\right)\right)}^{2} \cdot \left(2 \cdot z\right)}} \]
    9. Simplified35.0%

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

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

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

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

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

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

Alternative 10: 42.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+158} \lor \neg \left(x \leq 2.8 \cdot 10^{-40}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.6e158 or 2.8e-40 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e158 < x < 2.8e-40

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
    10. Step-by-step derivation
      1. distribute-lft-neg-in42.8%

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

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

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

Alternative 11: 57.6% accurate, 1.9× speedup?

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

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

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


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

    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. *-commutative99.3%

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

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

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

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

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

    if 3.4999999999999998e144 < t

    1. Initial program 100.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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\left(\sqrt{\sqrt{z \cdot 2} \cdot \mathsf{fma}\left(x, 0.5, -y\right)}\right)}^{2}\right)}^{\color{blue}{\left(0.5 + 0.5\right)}} \]
      8. pow-prod-up5.9%

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

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

      \[\leadsto \color{blue}{{\left(\left(2 \cdot z\right) \cdot {\left(\mathsf{fma}\left(0.5, x, y\right)\right)}^{2}\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. unpow1/235.0%

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

        \[\leadsto \sqrt{\color{blue}{{\left(\mathsf{fma}\left(0.5, x, y\right)\right)}^{2} \cdot \left(2 \cdot z\right)}} \]
    9. Simplified35.0%

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

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

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

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

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

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

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

Alternative 12: 30.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
  10. Step-by-step derivation
    1. distribute-lft-neg-in33.1%

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

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

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

Alternative 13: 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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