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

Percentage Accurate: 99.4% → 99.8%
Time: 16.3s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

\\
\left(x \cdot 0.5 - y\right) \cdot {\left(z \cdot \left(2 \cdot {\left(e^{t}\right)}^{t}\right)\right)}^{0.5}
\end{array}
Derivation
  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. sqr-neg99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \left(z \cdot 2\right)}
\end{array}
Derivation
  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. sqr-neg99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.0% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999972e58 < (*.f64 z 2)

    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. sqr-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.5% accurate, 1.9× speedup?

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

\\
\left(x \cdot 0.5 - y\right) \cdot {\left(z \cdot \left(2 \cdot \left(t \cdot t + 1\right)\right)\right)}^{0.5}
\end{array}
Derivation
  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. sqr-neg99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 56.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999983e27 < t

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 56.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000001e32 < t

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 37.2% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.1e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \sqrt{2 \cdot z}} \]
    12. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

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

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

    if -3.1e-7 < y

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 16.2% accurate, 2.0× speedup?

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

\\
\sqrt{\left(z \cdot 2\right) \cdot \left(y \cdot y\right)}
\end{array}
Derivation
  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. Taylor expanded in t around 0 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y \cdot \sqrt{2 \cdot z}} \]
  12. Step-by-step derivation
    1. add-sqr-sqrt1.9%

      \[\leadsto \color{blue}{\sqrt{y \cdot \sqrt{2 \cdot z}} \cdot \sqrt{y \cdot \sqrt{2 \cdot z}}} \]
    2. sqrt-unprod16.0%

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

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

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

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

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

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

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

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

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

Alternative 9: 2.5% accurate, 2.0× speedup?

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

\\
y \cdot \sqrt{z \cdot 2}
\end{array}
Derivation
  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. Taylor expanded in t around 0 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.4% accurate, 0.7× speedup?

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

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

Reproduce

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