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

Percentage Accurate: 99.3% → 99.8%
Time: 26.6s
Alternatives: 10
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 10 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    3. exp-prod99.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) \]
    4. *-commutative99.8%

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

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

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

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    8. associate-*l*80.7%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    9. exp-prod80.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    10. pow280.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
  3. Applied egg-rr80.6%

    \[\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)} \]
  4. 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. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    3. exp-prod99.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) \]
    4. *-commutative99.8%

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

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

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

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    8. associate-*l*80.7%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    9. exp-prod80.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    10. pow280.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
  3. Applied egg-rr80.6%

    \[\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)} \]
  4. 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. sub-neg99.7%

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 0.7× speedup?

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

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    3. exp-prod99.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) \]
    4. *-commutative99.8%

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

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

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

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    8. associate-*l*80.7%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    9. exp-prod80.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    10. pow280.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
  3. Applied egg-rr80.6%

    \[\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)} \]
  4. 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. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.3% accurate, 1.0× speedup?

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

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

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

Alternative 5: 61.4% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq 3.4 \cdot 10^{+46} \lor \neg \left(t \leq 2 \cdot 10^{+119}\right):\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(t_1 \cdot t_1\right)}\\

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


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

    1. Initial program 99.2%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      3. exp-prod99.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) \]
      4. *-commutative99.8%

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

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

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

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      8. associate-*l*87.3%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      9. exp-prod87.2%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      10. pow287.2%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    3. Applied egg-rr87.2%

      \[\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)} \]
    4. 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. sub-neg99.7%

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

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

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

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

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

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

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

    if 55 < t < 3.3999999999999998e46 or 1.99999999999999989e119 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.3999999999999998e46 < t < 1.99999999999999989e119

    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. Taylor expanded in t around 0 4.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 55:\\ \;\;\;\;\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot z}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+46} \lor \neg \left(t \leq 2 \cdot 10^{+119}\right):\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \left(0.5 \cdot x - y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left(2 \cdot z\right) \cdot {y}^{2}}\\ \end{array} \]

Alternative 6: 84.7% accurate, 1.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (* (- (* 0.5 x) y) (sqrt (* 2.0 (* z (fma t t 1.0))))))
t = abs(t);
double code(double x, double y, double z, double t) {
	return ((0.5 * x) - y) * sqrt((2.0 * (z * fma(t, t, 1.0))));
}
t = abs(t)
function code(x, y, z, t)
	return Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * Float64(z * fma(t, t, 1.0)))))
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_] := N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(z * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}
\end{array}
Derivation
  1. Initial program 99.4%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    3. exp-prod99.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) \]
    4. *-commutative99.8%

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

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

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

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    8. associate-*l*80.7%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    9. exp-prod80.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    10. pow280.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
  3. Applied egg-rr80.6%

    \[\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)} \]
  4. 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. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.8% accurate, 1.8× speedup?

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

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


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

    1. Initial program 99.2%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      3. exp-prod99.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) \]
      4. *-commutative99.8%

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

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

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

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      8. associate-*l*87.3%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      9. exp-prod87.2%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      10. pow287.2%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    3. Applied egg-rr87.2%

      \[\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)} \]
    4. 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. sub-neg99.7%

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

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

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

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

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

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

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

    if 50 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.6% accurate, 1.9× speedup?

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

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


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

    1. Initial program 99.2%

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
      3. exp-prod99.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) \]
      4. *-commutative99.8%

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

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

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

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      8. associate-*l*87.3%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      9. exp-prod87.2%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
      10. pow287.2%

        \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    3. Applied egg-rr87.2%

      \[\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)} \]
    4. 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. sub-neg99.7%

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

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

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

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

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

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

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

    if 29 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 57.1% accurate, 2.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot z} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t) :precision binary64 (* (- (* 0.5 x) y) (sqrt (* 2.0 z))))
t = abs(t);
double code(double x, double y, double z, double t) {
	return ((0.5 * x) - y) * sqrt((2.0 * z));
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((0.5d0 * x) - y) * sqrt((2.0d0 * z))
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t) {
	return ((0.5 * x) - y) * Math.sqrt((2.0 * z));
}
t = abs(t)
def code(x, y, z, t):
	return ((0.5 * x) - y) * math.sqrt((2.0 * z))
t = abs(t)
function code(x, y, z, t)
	return Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * z)))
end
t = abs(t)
function tmp = code(x, y, z, t)
	tmp = ((0.5 * x) - y) * sqrt((2.0 * z));
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_] := N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot z}
\end{array}
Derivation
  1. Initial program 99.4%

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

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

      \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right) \]
    3. exp-prod99.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) \]
    4. *-commutative99.8%

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

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

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

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    8. associate-*l*80.7%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    9. exp-prod80.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
    10. pow280.6%

      \[\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 \sqrt{{\left(e^{t}\right)}^{t}}\right) \cdot \left(-y\right) \]
  3. Applied egg-rr80.6%

    \[\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)} \]
  4. 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. sub-neg99.7%

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

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

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

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

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

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

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

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

Alternative 10: 30.0% accurate, 2.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ \sqrt{2 \cdot z} \cdot \left(-y\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t) :precision binary64 (* (sqrt (* 2.0 z)) (- y)))
t = abs(t);
double code(double x, double y, double z, double t) {
	return sqrt((2.0 * z)) * -y;
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = sqrt((2.0d0 * z)) * -y
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t) {
	return Math.sqrt((2.0 * z)) * -y;
}
t = abs(t)
def code(x, y, z, t):
	return math.sqrt((2.0 * z)) * -y
t = abs(t)
function code(x, y, z, t)
	return Float64(sqrt(Float64(2.0 * z)) * Float64(-y))
end
t = abs(t)
function tmp = code(x, y, z, t)
	tmp = sqrt((2.0 * z)) * -y;
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sqrt{2 \cdot z} \cdot \left(-y\right)
\end{array}
Derivation
  1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.3% 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 2023301 
(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))))