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

Percentage Accurate: 99.2% → 99.8%
Time: 18.5s
Alternatives: 14
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 14 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.2% 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} \\ \sqrt{z \cdot 2} \cdot \left(\sqrt{e^{t \cdot t}} \cdot \left(x \cdot 0.5 - y\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (sqrt (* z 2.0)) (* (sqrt (exp (* t t))) (- (* x 0.5) y))))
double code(double x, double y, double z, double t) {
	return sqrt((z * 2.0)) * (sqrt(exp((t * t))) * ((x * 0.5) - y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = sqrt((z * 2.0d0)) * (sqrt(exp((t * t))) * ((x * 0.5d0) - y))
end function
public static double code(double x, double y, double z, double t) {
	return Math.sqrt((z * 2.0)) * (Math.sqrt(Math.exp((t * t))) * ((x * 0.5) - y));
}
def code(x, y, z, t):
	return math.sqrt((z * 2.0)) * (math.sqrt(math.exp((t * t))) * ((x * 0.5) - y))
function code(x, y, z, t)
	return Float64(sqrt(Float64(z * 2.0)) * Float64(sqrt(exp(Float64(t * t))) * Float64(Float64(x * 0.5) - y)))
end
function tmp = code(x, y, z, t)
	tmp = sqrt((z * 2.0)) * (sqrt(exp((t * t))) * ((x * 0.5) - y));
end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6e18 < t

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 63.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 6.5 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot t_1\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{+151}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t_1}^{2}}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

    if 6.5e18 < t < 3.5000000000000003e151

    1. Initial program 95.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. *-commutative95.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*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000003e151 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 4 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot t_1\\

\mathbf{elif}\;t \leq 4.2 \cdot 10^{+78}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t_1}^{2}}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

    if 4e18 < t < 4.2000000000000002e78

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000002e78 < t

    1. Initial program 97.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. *-commutative97.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*100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.2% accurate, 1.0× speedup?

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

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

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

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

Alternative 7: 84.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot x - y\right) \cdot \sqrt{\left(\color{blue}{{t}^{2} \cdot z} + z\right) \cdot 2} \]
    6. distribute-lft1-in85.0%

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

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

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

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

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

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

Alternative 8: 56.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 2.15 \cdot 10^{+142} \lor \neg \left(t \leq 1.7 \cdot 10^{+223}\right):\\
\;\;\;\;\sqrt{z \cdot \left(0.5 \cdot {x}^{2}\right)}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

    if 3.5e18 < t < 2.15000000000000006e142 or 1.6999999999999999e223 < t

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.15000000000000006e142 < t < 1.6999999999999999e223

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 3.5 \cdot 10^{+18}:\\ \;\;\;\;\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{+142} \lor \neg \left(t \leq 1.7 \cdot 10^{+223}\right):\\ \;\;\;\;\sqrt{z \cdot \left(0.5 \cdot {x}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\ \end{array} \]

Alternative 9: 56.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 1.6 \cdot 10^{+129} \lor \neg \left(t \leq 1.8 \cdot 10^{+224}\right):\\
\;\;\;\;\sqrt{z \cdot \left(0.5 \cdot {x}^{2}\right)}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

    if 7.2e18 < t < 1.6000000000000001e129 or 1.8e224 < t

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6000000000000001e129 < t < 1.8e224

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 7.2 \cdot 10^{+18}:\\ \;\;\;\;\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+129} \lor \neg \left(t \leq 1.8 \cdot 10^{+224}\right):\\ \;\;\;\;\sqrt{z \cdot \left(0.5 \cdot {x}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {y}^{2}}\\ \end{array} \]

Alternative 10: 59.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 2.95 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot t_1\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

    if 2.95e18 < t

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 42.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+89} \lor \neg \left(y \leq 7.2 \cdot 10^{-38}\right):\\
\;\;\;\;t_1 \cdot \left(-y\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(x \cdot 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.09999999999999986e89 or 7.2000000000000001e-38 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0 - y \cdot \sqrt{2 \cdot z}} \]
    10. Step-by-step derivation
      1. neg-sub046.3%

        \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
      2. distribute-lft-neg-in46.3%

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

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

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

    if -2.09999999999999986e89 < y < 7.2000000000000001e-38

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 56.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 13: 29.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-y \cdot \sqrt{2 \cdot z}} \]
    2. distribute-lft-neg-in27.2%

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

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

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

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

Alternative 14: 2.4% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.2% 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 2023321 
(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))))