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

Percentage Accurate: 99.4% → 99.8%
Time: 17.3s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 72.9% accurate, 1.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ t_2 := \sqrt{2 \cdot z}\\ \mathbf{if}\;t\_m \leq 6.5 \cdot 10^{-31}:\\ \;\;\;\;t\_1 \cdot t\_2\\ \mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+74}:\\ \;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(t\_m \cdot t\_2\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* 2.0 z))))
   (if (<= t_m 6.5e-31)
     (* t_1 t_2)
     (if (<= t_m 1.05e+74)
       (* t_1 (cbrt (pow (* 2.0 z) 1.5)))
       (* t_1 (* t_m t_2))))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
	double t_1 = (x * 0.5) - y;
	double t_2 = sqrt((2.0 * z));
	double tmp;
	if (t_m <= 6.5e-31) {
		tmp = t_1 * t_2;
	} else if (t_m <= 1.05e+74) {
		tmp = t_1 * cbrt(pow((2.0 * z), 1.5));
	} else {
		tmp = t_1 * (t_m * t_2);
	}
	return tmp;
}
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
	double t_1 = (x * 0.5) - y;
	double t_2 = Math.sqrt((2.0 * z));
	double tmp;
	if (t_m <= 6.5e-31) {
		tmp = t_1 * t_2;
	} else if (t_m <= 1.05e+74) {
		tmp = t_1 * Math.cbrt(Math.pow((2.0 * z), 1.5));
	} else {
		tmp = t_1 * (t_m * t_2);
	}
	return tmp;
}
t_m = abs(t)
function code(x, y, z, t_m)
	t_1 = Float64(Float64(x * 0.5) - y)
	t_2 = sqrt(Float64(2.0 * z))
	tmp = 0.0
	if (t_m <= 6.5e-31)
		tmp = Float64(t_1 * t_2);
	elseif (t_m <= 1.05e+74)
		tmp = Float64(t_1 * cbrt((Float64(2.0 * z) ^ 1.5)));
	else
		tmp = Float64(t_1 * Float64(t_m * t_2));
	end
	return tmp
end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$m, 6.5e-31], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+74], N[(t$95$1 * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$m * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t\_m \leq 6.5 \cdot 10^{-31}:\\
\;\;\;\;t\_1 \cdot t\_2\\

\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+74}:\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_m \cdot t\_2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 6.49999999999999967e-31

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.49999999999999967e-31 < t < 1.0499999999999999e74

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0499999999999999e74 < 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. associate-*l*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. associate-*l*55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4000000000000001e24 < 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. associate-*l*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 76.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.4% accurate, 1.0× speedup?

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

\\
e^{\frac{t\_m \cdot t\_m}{2}} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right)
\end{array}
Derivation
  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. Add Preprocessing
  3. Final simplification99.8%

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

Alternative 7: 85.3% accurate, 1.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t\_m, t\_m, 1\right)} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
 :precision binary64
 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (fma t_m t_m 1.0)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
	return ((x * 0.5) - y) * sqrt(((2.0 * z) * fma(t_m, t_m, 1.0)));
}
t_m = abs(t)
function code(x, y, z, t_m)
	return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * fma(t_m, t_m, 1.0))))
end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t$95$m * t$95$m + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t\_m, t\_m, 1\right)}
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \]
  13. Add Preprocessing

Alternative 8: 72.4% accurate, 1.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_m \cdot t\_1\\


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left({t}^{2} + 1\right)} \cdot \left(2 \cdot z\right)} \]
    12. Taylor expanded in t around inf 62.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. associate-*l*47.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 73.4% accurate, 1.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_m \cdot t\_2\right)\\


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left({t}^{2} + 1\right)} \cdot \left(2 \cdot z\right)} \]
    12. Taylor expanded in t around inf 62.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. associate-*l*47.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 30.2% accurate, 2.0× speedup?

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

\\
0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)
\end{array}
Derivation
  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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.4% accurate, 0.7× speedup?

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

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

Reproduce

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