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

Percentage Accurate: 99.5% → 99.8%
Time: 12.3s
Alternatives: 8
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 8 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 59.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 4.1 \cdot 10^{+133}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 3.1 \cdot 10^{+190}:\\
\;\;\;\;0.5 \cdot \left(x \cdot {\left({\left(z \cdot 2\right)}^{1.5}\right)}^{0.3333333333333333}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 19 < t < 4.10000000000000004e133 or 3.1000000000000001e190 < t

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.10000000000000004e133 < t < 3.1000000000000001e190

    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. Add Preprocessing
    3. Taylor expanded in t around 0 20.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 1:\\ \;\;\;\;t\_1 \cdot \sqrt{z \cdot 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 1.0)
     (* t_1 (sqrt (* z 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 <= 1.0) {
		tmp = t_1 * sqrt((z * 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 <= 1.0d0) then
        tmp = t_1 * sqrt((z * 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 <= 1.0) {
		tmp = t_1 * Math.sqrt((z * 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 <= 1.0:
		tmp = t_1 * math.sqrt((z * 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 <= 1.0)
		tmp = Float64(t_1 * sqrt(Float64(z * 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 <= 1.0)
		tmp = t_1 * sqrt((z * 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, 1.0], N[(t$95$1 * N[Sqrt[N[(z * 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 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 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 2 regimes
  2. if t < 1

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < t

    1. Initial program 98.4%

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

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

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

        \[\leadsto \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right) \cdot \color{blue}{\left(x \cdot 0.5 + \left(-y\right)\right)} \]
      4. distribute-lft-in47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 64.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \leq 1:\\ \;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\sqrt{z} \cdot \left(t\_1 \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 1.0)
     (* t_1 (sqrt (* z 2.0)))
     (* t (* (sqrt z) (* t_1 (sqrt 2.0)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if (t <= 1.0) {
		tmp = t_1 * sqrt((z * 2.0));
	} else {
		tmp = t * (sqrt(z) * (t_1 * 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 <= 1.0d0) then
        tmp = t_1 * sqrt((z * 2.0d0))
    else
        tmp = t * (sqrt(z) * (t_1 * 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 <= 1.0) {
		tmp = t_1 * Math.sqrt((z * 2.0));
	} else {
		tmp = t * (Math.sqrt(z) * (t_1 * Math.sqrt(2.0)));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * 0.5) - y
	tmp = 0
	if t <= 1.0:
		tmp = t_1 * math.sqrt((z * 2.0))
	else:
		tmp = t * (math.sqrt(z) * (t_1 * 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 <= 1.0)
		tmp = Float64(t_1 * sqrt(Float64(z * 2.0)));
	else
		tmp = Float64(t * Float64(sqrt(z) * Float64(t_1 * 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 <= 1.0)
		tmp = t_1 * sqrt((z * 2.0));
	else
		tmp = t * (sqrt(z) * (t_1 * 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, 1.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[z], $MachinePrecision] * N[(t$95$1 * 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 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < t

    1. Initial program 98.4%

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

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

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

        \[\leadsto \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right) \cdot \color{blue}{\left(x \cdot 0.5 + \left(-y\right)\right)} \]
      4. distribute-lft-in47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 59.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

        \[\leadsto \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right) \cdot \color{blue}{\left(x \cdot 0.5 + \left(-y\right)\right)} \]
      4. distribute-lft-in84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2000000000000001e42 < t

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right) \cdot \color{blue}{\left(x \cdot 0.5 + \left(-y\right)\right)} \]
    4. distribute-lft-in77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.2% accurate, 2.0× speedup?

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

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

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

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

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

      \[\leadsto \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right) \cdot \color{blue}{\left(x \cdot 0.5 + \left(-y\right)\right)} \]
    4. distribute-lft-in77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 30.2% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.5% accurate, 0.7× speedup?

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

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

Reproduce

?
herbie shell --seed 2024101 
(FPCore (x y z t)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
  :precision binary64

  :alt
  (* (* (- (* 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))))