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

Percentage Accurate: 99.3% → 99.8%
Time: 13.5s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

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

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

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

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

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

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

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

      \[\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{e^{t \cdot t}}\right) \cdot \left(-y\right) \]
    8. pow-exp76.4%

      \[\leadsto \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{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \cdot \left(-y\right) \]
    9. sqrt-unprod76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

      \[\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{e^{t \cdot t}}\right) \cdot \left(-y\right) \]
    8. pow-exp76.4%

      \[\leadsto \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{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \cdot \left(-y\right) \]
    9. sqrt-unprod76.4%

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

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\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{e^{t \cdot t}}\right) \cdot \left(-y\right) \]
    8. pow-exp76.4%

      \[\leadsto \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{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \cdot \left(-y\right) \]
    9. sqrt-unprod76.4%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.1% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 t t) < 2e-3

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}} \cdot \color{blue}{\left(0.5 \cdot x + \left(-y\right)\right)} \]
      10. distribute-lft-in65.7%

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

        \[\leadsto \color{blue}{{\left({\left(z \cdot 2\right)}^{1.5}\right)}^{0.3333333333333333}} \cdot \left(0.5 \cdot x\right) + \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}} \cdot \left(-y\right) \]
      12. pow-pow73.9%

        \[\leadsto \color{blue}{{\left(z \cdot 2\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \cdot \left(0.5 \cdot x\right) + \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}} \cdot \left(-y\right) \]
      13. metadata-eval73.9%

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

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

        \[\leadsto \sqrt{z \cdot 2} \cdot \left(0.5 \cdot x\right) + \color{blue}{{\left({\left(z \cdot 2\right)}^{1.5}\right)}^{0.3333333333333333}} \cdot \left(-y\right) \]
      16. pow-pow99.2%

        \[\leadsto \sqrt{z \cdot 2} \cdot \left(0.5 \cdot x\right) + \color{blue}{{\left(z \cdot 2\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \cdot \left(-y\right) \]
      17. metadata-eval99.2%

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

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

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

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

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

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

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

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

    if 2e-3 < (*.f64 t 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. 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. exp-sqrt100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \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{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}} \]
      5. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.3% accurate, 1.9× speedup?

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

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

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

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

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

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

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

      \[\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{e^{t \cdot t}}\right) \cdot \left(-y\right) \]
    8. pow-exp76.4%

      \[\leadsto \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{\color{blue}{{\left(e^{t}\right)}^{t}}}\right) \cdot \left(-y\right) \]
    9. sqrt-unprod76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 44.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(-\sqrt{2 \cdot z}\right)\\ \mathbf{if}\;y \leq -3.6 \cdot 10^{+134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{+43}:\\ \;\;\;\;\sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-99} \lor \neg \left(y \leq 3.1 \cdot 10^{+93}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- (sqrt (* 2.0 z))))))
   (if (<= y -3.6e+134)
     t_1
     (if (<= y -1.2e+43)
       (sqrt (* 2.0 (* y (* y z))))
       (if (or (<= y -6.5e-99) (not (<= y 3.1e+93)))
         t_1
         (* x (sqrt (* 0.5 z))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * -sqrt((2.0 * z));
	double tmp;
	if (y <= -3.6e+134) {
		tmp = t_1;
	} else if (y <= -1.2e+43) {
		tmp = sqrt((2.0 * (y * (y * z))));
	} else if ((y <= -6.5e-99) || !(y <= 3.1e+93)) {
		tmp = t_1;
	} else {
		tmp = x * sqrt((0.5 * z));
	}
	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 = y * -sqrt((2.0d0 * z))
    if (y <= (-3.6d+134)) then
        tmp = t_1
    else if (y <= (-1.2d+43)) then
        tmp = sqrt((2.0d0 * (y * (y * z))))
    else if ((y <= (-6.5d-99)) .or. (.not. (y <= 3.1d+93))) then
        tmp = t_1
    else
        tmp = x * sqrt((0.5d0 * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * -Math.sqrt((2.0 * z));
	double tmp;
	if (y <= -3.6e+134) {
		tmp = t_1;
	} else if (y <= -1.2e+43) {
		tmp = Math.sqrt((2.0 * (y * (y * z))));
	} else if ((y <= -6.5e-99) || !(y <= 3.1e+93)) {
		tmp = t_1;
	} else {
		tmp = x * Math.sqrt((0.5 * z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * -math.sqrt((2.0 * z))
	tmp = 0
	if y <= -3.6e+134:
		tmp = t_1
	elif y <= -1.2e+43:
		tmp = math.sqrt((2.0 * (y * (y * z))))
	elif (y <= -6.5e-99) or not (y <= 3.1e+93):
		tmp = t_1
	else:
		tmp = x * math.sqrt((0.5 * z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(-sqrt(Float64(2.0 * z))))
	tmp = 0.0
	if (y <= -3.6e+134)
		tmp = t_1;
	elseif (y <= -1.2e+43)
		tmp = sqrt(Float64(2.0 * Float64(y * Float64(y * z))));
	elseif ((y <= -6.5e-99) || !(y <= 3.1e+93))
		tmp = t_1;
	else
		tmp = Float64(x * sqrt(Float64(0.5 * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * -sqrt((2.0 * z));
	tmp = 0.0;
	if (y <= -3.6e+134)
		tmp = t_1;
	elseif (y <= -1.2e+43)
		tmp = sqrt((2.0 * (y * (y * z))));
	elseif ((y <= -6.5e-99) || ~((y <= 3.1e+93)))
		tmp = t_1;
	else
		tmp = x * sqrt((0.5 * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[y, -3.6e+134], t$95$1, If[LessEqual[y, -1.2e+43], N[Sqrt[N[(2.0 * N[(y * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[y, -6.5e-99], N[Not[LessEqual[y, 3.1e+93]], $MachinePrecision]], t$95$1, N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(-\sqrt{2 \cdot z}\right)\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+134}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.2 \cdot 10^{+43}:\\
\;\;\;\;\sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-99} \lor \neg \left(y \leq 3.1 \cdot 10^{+93}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.59999999999999988e134 or -1.20000000000000012e43 < y < -6.50000000000000033e-99 or 3.10000000000000019e93 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{2 \cdot z} \cdot y} \]
    10. Step-by-step derivation
      1. distribute-rgt-neg-in59.5%

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

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

    if -3.59999999999999988e134 < y < -1.20000000000000012e43

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.50000000000000033e-99 < y < 3.10000000000000019e93

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{z \cdot \left(\left(2 \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{0.25}\right)} \]
    9. Applied egg-rr24.2%

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

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

        \[\leadsto \sqrt{z \cdot \color{blue}{\left(\left(0.25 \cdot 2\right) \cdot \left(x \cdot x\right)\right)}} \]
      3. metadata-eval24.2%

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      3. sqrt-prod17.2%

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

        \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
    13. Applied egg-rr39.4%

      \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{+134}:\\ \;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{+43}:\\ \;\;\;\;\sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-99} \lor \neg \left(y \leq 3.1 \cdot 10^{+93}\right):\\ \;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \end{array} \]

Alternative 7: 57.6% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 1/2) < 4.00000000000000023e136

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left({\left(z \cdot 2\right)}^{1.5}\right)}^{0.3333333333333333}} \cdot \left(0.5 \cdot x\right) + \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}} \cdot \left(-y\right) \]
      12. pow-pow48.9%

        \[\leadsto \color{blue}{{\left(z \cdot 2\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \cdot \left(0.5 \cdot x\right) + \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}} \cdot \left(-y\right) \]
      13. metadata-eval48.9%

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

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

        \[\leadsto \sqrt{z \cdot 2} \cdot \left(0.5 \cdot x\right) + \color{blue}{{\left({\left(z \cdot 2\right)}^{1.5}\right)}^{0.3333333333333333}} \cdot \left(-y\right) \]
      16. pow-pow58.2%

        \[\leadsto \sqrt{z \cdot 2} \cdot \left(0.5 \cdot x\right) + \color{blue}{{\left(z \cdot 2\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \cdot \left(-y\right) \]
      17. metadata-eval58.2%

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

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

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

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

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

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

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

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

    if 4.00000000000000023e136 < (*.f64 x 1/2)

    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 56.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{z \cdot \left(\left(2 \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{0.25}\right)} \]
    9. Applied egg-rr72.7%

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

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

        \[\leadsto \sqrt{z \cdot \color{blue}{\left(\left(0.25 \cdot 2\right) \cdot \left(x \cdot x\right)\right)}} \]
      3. metadata-eval72.7%

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

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

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

Alternative 8: 44.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+96}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\

\mathbf{elif}\;x \leq 7.5 \cdot 10^{+119}:\\
\;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.8e96

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{z \cdot \left(\left(2 \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{0.25}\right)} \]
    9. Applied egg-rr5.7%

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

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

        \[\leadsto \sqrt{z \cdot \color{blue}{\left(\left(0.25 \cdot 2\right) \cdot \left(x \cdot x\right)\right)}} \]
      3. metadata-eval5.7%

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      3. sqrt-prod0.0%

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

        \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
    13. Applied egg-rr54.4%

      \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot x} \]

    if -7.8e96 < x < 7.500000000000001e119

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.500000000000001e119 < x

    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 55.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{z \cdot \left(\left(2 \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{0.25}\right)} \]
    9. Applied egg-rr66.5%

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

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

        \[\leadsto \sqrt{z \cdot \color{blue}{\left(\left(0.25 \cdot 2\right) \cdot \left(x \cdot x\right)\right)}} \]
      3. metadata-eval66.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{+96}:\\ \;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+119}:\\ \;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{z \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)}\\ \end{array} \]

Alternative 9: 43.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-100} \lor \neg \left(y \leq 3.3 \cdot 10^{+93}\right):\\
\;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.35000000000000008e-100 or 3.30000000000000009e93 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000008e-100 < y < 3.30000000000000009e93

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{z \cdot \left(\left(2 \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{0.25}\right)} \]
    9. Applied egg-rr24.2%

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

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

        \[\leadsto \sqrt{z \cdot \color{blue}{\left(\left(0.25 \cdot 2\right) \cdot \left(x \cdot x\right)\right)}} \]
      3. metadata-eval24.2%

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

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

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

        \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
      3. sqrt-prod17.2%

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

        \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
    13. Applied egg-rr39.4%

      \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.8%

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

Alternative 10: 2.4% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 30.4% accurate, 2.0× speedup?

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

\\
x \cdot \sqrt{0.5 \cdot z}
\end{array}
Derivation
  1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{z \cdot \left(\left(2 \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{0.25}\right)} \]
  9. Applied egg-rr17.2%

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

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

      \[\leadsto \sqrt{z \cdot \color{blue}{\left(\left(0.25 \cdot 2\right) \cdot \left(x \cdot x\right)\right)}} \]
    3. metadata-eval17.2%

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

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

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

      \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot \sqrt{x \cdot x}} \]
    3. sqrt-prod9.5%

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

      \[\leadsto \sqrt{z \cdot 0.5} \cdot \color{blue}{x} \]
  13. Applied egg-rr24.0%

    \[\leadsto \color{blue}{\sqrt{z \cdot 0.5} \cdot x} \]
  14. Final simplification24.0%

    \[\leadsto x \cdot \sqrt{0.5 \cdot z} \]

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 2023185 
(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))))