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

Percentage Accurate: 99.5% → 99.1%
Time: 2.5s
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.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot 0.5 - y\\ \mathbf{if}\;t \cdot t \leq 290:\\ \;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot e^{\frac{t \cdot t}{2}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x 0.5) y)))
   (if (<= (* t t) 290.0)
     (* t_1 (sqrt (* z 2.0)))
     (* t_1 (exp (/ (* t t) 2.0))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if ((t * t) <= 290.0) {
		tmp = t_1 * sqrt((z * 2.0));
	} else {
		tmp = t_1 * exp(((t * t) / 2.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * 0.5d0) - y
    if ((t * t) <= 290.0d0) then
        tmp = t_1 * sqrt((z * 2.0d0))
    else
        tmp = t_1 * exp(((t * t) / 2.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x * 0.5) - y;
	double tmp;
	if ((t * t) <= 290.0) {
		tmp = t_1 * Math.sqrt((z * 2.0));
	} else {
		tmp = t_1 * Math.exp(((t * t) / 2.0));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * 0.5) - y
	tmp = 0
	if (t * t) <= 290.0:
		tmp = t_1 * math.sqrt((z * 2.0))
	else:
		tmp = t_1 * math.exp(((t * t) / 2.0))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * 0.5) - y)
	tmp = 0.0
	if (Float64(t * t) <= 290.0)
		tmp = Float64(t_1 * sqrt(Float64(z * 2.0)));
	else
		tmp = Float64(t_1 * exp(Float64(Float64(t * t) / 2.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * 0.5) - y;
	tmp = 0.0;
	if ((t * t) <= 290.0)
		tmp = t_1 * sqrt((z * 2.0));
	else
		tmp = t_1 * exp(((t * t) / 2.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 290.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{\frac{t \cdot t}{2}}\\


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

    1. Initial program 99.6%

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

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

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

    if 290 < (*.f64 t t)

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(y \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right)} \cdot e^{\frac{t \cdot t}{2}} \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right)} \cdot e^{\frac{t \cdot t}{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 18.4% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(t \cdot t\right) \cdot t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (-.f64 (*.f64 x #s(literal 1/2 binary64)) y) (sqrt.f64 (*.f64 z #s(literal 2 binary64)))) (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64)))) < -4.99999999999999956e-215

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

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

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

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

      \[\leadsto x \cdot 0.5 - \color{blue}{y} \]

    if -4.99999999999999956e-215 < (*.f64 (*.f64 (-.f64 (*.f64 x #s(literal 1/2 binary64)) y) (sqrt.f64 (*.f64 z #s(literal 2 binary64)))) (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64))))

    1. Initial program 99.2%

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

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

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

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

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

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

      \[\leadsto \left(t \cdot t\right) \cdot \sqrt{\color{blue}{z \cdot 2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 17.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (-.f64 (*.f64 x #s(literal 1/2 binary64)) y) (sqrt.f64 (*.f64 z #s(literal 2 binary64)))) (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64)))) < 4.9999999999999996e292

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

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

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

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

      \[\leadsto x \cdot 0.5 - \color{blue}{y} \]

    if 4.9999999999999996e292 < (*.f64 (*.f64 (-.f64 (*.f64 x #s(literal 1/2 binary64)) y) (sqrt.f64 (*.f64 z #s(literal 2 binary64)))) (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64))))

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

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

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

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

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

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

      \[\leadsto t \cdot \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 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}
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. Add Preprocessing
  3. Add Preprocessing

Alternative 5: 86.4% accurate, 1.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 0.5\right) \cdot e^{\frac{t \cdot t}{2}}\\


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

    1. Initial program 99.6%

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

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

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

    if 320 < (*.f64 t t)

    1. Initial program 99.2%

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

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

      \[\leadsto \color{blue}{\left(x \cdot 0.5\right)} \cdot e^{\frac{t \cdot t}{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 65.6% accurate, 2.2× speedup?

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

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

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


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

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

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

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

    if 1.01999999999999996e192 < (*.f64 t 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. Add Preprocessing
    3. Taylor expanded in x around 0

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

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

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

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

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

      \[\leadsto \left(\frac{t \cdot t}{2} \cdot \sqrt{z \cdot 2}\right) \cdot \sqrt{\color{blue}{z \cdot 2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 65.3% accurate, 3.7× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

    if 2.89999999999999996e265 < (*.f64 t 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. Add Preprocessing
    3. Taylor expanded in x around 0

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

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

      \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{z \cdot 2}} \]
    6. Applied rewrites5.3%

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

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

      \[\leadsto \left(t \cdot t\right) \cdot \sqrt{\color{blue}{z \cdot 2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 40.1% accurate, 4.1× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 2.3 \cdot 10^{+235}:\\
\;\;\;\;\left(x \cdot 0.5\right) \cdot t\_1\\

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


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

    1. Initial program 99.2%

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

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

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

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

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

    if 2.3e235 < (*.f64 t 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. Add Preprocessing
    3. Taylor expanded in x around 0

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

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

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

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

      \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{z \cdot 2}} \]
    8. Applied rewrites44.0%

      \[\leadsto \left(t \cdot t\right) \cdot \sqrt{\color{blue}{z \cdot 2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 14.4% accurate, 25.0× speedup?

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

\\
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. Add Preprocessing
  3. Taylor expanded in x around 0

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

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

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

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

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

    \[\leadsto t \cdot \color{blue}{t} \]
  9. Add Preprocessing

Developer Target 1: 99.5% accurate, 0.6× 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 2024313 
(FPCore (x y z t)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
  :precision binary64

  :alt
  (! :herbie-platform default (* (* (- (* x 1/2) y) (sqrt (* z 2))) (pow (exp 1) (/ (* t t) 2))))

  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))