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

Percentage Accurate: 99.5% → 99.8%
Time: 11.4s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.8% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 4: 60.1% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;t \leq 7.2 \cdot 10^{+201}:\\
\;\;\;\;t_1 \cdot {\left(4 \cdot \left(z \cdot z\right)\right)}^{0.25}\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{+266}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot \left(y \cdot y\right)\right)}\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\left({z}^{0.25} \cdot {z}^{0.25}\right)}\right) \]
      4. unpow1/265.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{{2}^{0.5}} \cdot \left({z}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      5. metadata-eval65.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({2}^{\color{blue}{\left(2 \cdot 0.25\right)}} \cdot \left({z}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      6. pow-sqr65.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{\left({2}^{0.25} \cdot {2}^{0.25}\right)} \cdot \left({z}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      7. swap-sqr65.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\left({2}^{0.25} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)} \]
      8. exp-to-pow65.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      9. exp-to-pow63.4%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      10. exp-sum63.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      11. distribute-rgt-in63.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      12. log-prod63.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      13. *-commutative63.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      14. exp-to-pow65.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{{\left(2 \cdot z\right)}^{0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      15. exp-to-pow65.8%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right)\right) \]
      16. exp-to-pow63.4%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right)\right) \]
      17. exp-sum63.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}}\right) \]
      18. distribute-rgt-in63.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}}\right) \]
      19. log-prod63.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}}\right) \]
      20. *-commutative63.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}}\right) \]
      21. exp-to-pow65.8%

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

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

    if 4.79999999999999992e25 < t < 7.19999999999999951e201

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\left(2 \cdot z\right) \cdot \color{blue}{\left(2 \cdot z\right)}\right)}^{0.25} \]
      9. swap-sqr37.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\color{blue}{\left(\left(2 \cdot 2\right) \cdot \left(z \cdot z\right)\right)}}^{0.25} \]
      10. metadata-eval37.7%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot {\left(\color{blue}{4} \cdot \left(z \cdot z\right)\right)}^{0.25} \]
    6. Applied egg-rr37.7%

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

    if 7.19999999999999951e201 < t < 8.49999999999999955e266

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999955e266 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 4.8 \cdot 10^{+25}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+201}:\\ \;\;\;\;\left(x \cdot 0.5 - y\right) \cdot {\left(4 \cdot \left(z \cdot z\right)\right)}^{0.25}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+266}:\\ \;\;\;\;\sqrt{z \cdot \left(2 \cdot \left(y \cdot y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(x \cdot x\right) \cdot \left(0.5 \cdot z\right)}\\ \end{array} \]

Alternative 5: 84.7% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.0% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\left({z}^{0.25} \cdot {z}^{0.25}\right)}\right) \]
      4. unpow1/261.4%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{{2}^{0.5}} \cdot \left({z}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      5. metadata-eval61.4%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({2}^{\color{blue}{\left(2 \cdot 0.25\right)}} \cdot \left({z}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      6. pow-sqr61.4%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{\left({2}^{0.25} \cdot {2}^{0.25}\right)} \cdot \left({z}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      7. swap-sqr61.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\left({2}^{0.25} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right)} \]
      8. exp-to-pow61.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      9. exp-to-pow59.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right) \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      10. exp-sum59.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      11. distribute-rgt-in59.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      12. log-prod59.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      13. *-commutative59.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      14. exp-to-pow61.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{{\left(2 \cdot z\right)}^{0.25}} \cdot \left({2}^{0.25} \cdot {z}^{0.25}\right)\right) \]
      15. exp-to-pow61.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(\color{blue}{e^{\log 2 \cdot 0.25}} \cdot {z}^{0.25}\right)\right) \]
      16. exp-to-pow59.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \left(e^{\log 2 \cdot 0.25} \cdot \color{blue}{e^{\log z \cdot 0.25}}\right)\right) \]
      17. exp-sum59.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{e^{\log 2 \cdot 0.25 + \log z \cdot 0.25}}\right) \]
      18. distribute-rgt-in59.1%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{0.25 \cdot \left(\log 2 + \log z\right)}}\right) \]
      19. log-prod59.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{0.25 \cdot \color{blue}{\log \left(2 \cdot z\right)}}\right) \]
      20. *-commutative59.3%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot e^{\color{blue}{\log \left(2 \cdot z\right) \cdot 0.25}}\right) \]
      21. exp-to-pow61.5%

        \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \left({\left(2 \cdot z\right)}^{0.25} \cdot \color{blue}{{\left(2 \cdot z\right)}^{0.25}}\right) \]
    9. Simplified61.7%

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

    if 2.3000000000000001e195 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 23.9% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.1200000000000001e29

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1200000000000001e29 < x

    1. Initial program 99.9%

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

        \[\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. associate-*l/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 16.7% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 16.8% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 99.5% accurate, 0.7× speedup?

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

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

Reproduce

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