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

Percentage Accurate: 99.4% → 99.4%
Time: 6.1s
Alternatives: 13
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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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 13 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.4% 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\left(t \cdot t\right) \cdot 0.5} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (* (* t t) 0.5))))
double code(double x, double y, double z, double t) {
	return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) * 0.5));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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) * 0.5d0))
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) * 0.5));
}
def code(x, y, z, t):
	return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) * 0.5))
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) * 0.5)))
end
function tmp = code(x, y, z, t)
	tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) * 0.5));
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] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\left(t \cdot t\right) \cdot 0.5}
\end{array}
Derivation
  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. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{e^{\frac{t \cdot t}{2}}} \]
    2. lift-*.f64N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{\color{blue}{t \cdot t}}{2}} \]
    3. lift-/.f64N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{\frac{t \cdot t}{2}}} \]
    4. pow2N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{\color{blue}{{t}^{2}}}{2}} \]
    5. exp-sqrtN/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\sqrt{e^{{t}^{2}}}} \]
    6. pow1/2N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{{\left(e^{{t}^{2}}\right)}^{\frac{1}{2}}} \]
    7. exp-prodN/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{e^{{t}^{2} \cdot \frac{1}{2}}} \]
    8. *-commutativeN/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{\frac{1}{2} \cdot {t}^{2}}} \]
    9. lower-exp.f64N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{e^{\frac{1}{2} \cdot {t}^{2}}} \]
    10. *-commutativeN/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{{t}^{2} \cdot \frac{1}{2}}} \]
    11. lower-*.f64N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{{t}^{2} \cdot \frac{1}{2}}} \]
    12. pow2N/A

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{\left(t \cdot t\right)} \cdot \frac{1}{2}} \]
    13. lift-*.f6498.7

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

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

Alternative 2: 92.5% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z \cdot 2}\\ \mathbf{if}\;t \leq 50000000000 \lor \neg \left(t \leq 9 \cdot 10^{+65}\right):\\ \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot t\_1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.125, t \cdot t, 0.5\right) \cdot t, t, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-y\right) \cdot t\_1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* z 2.0))))
   (if (or (<= t 50000000000.0) (not (<= t 9e+65)))
     (* (* (- (* x 0.5) y) t_1) (fma (* (fma 0.125 (* t t) 0.5) t) t 1.0))
     (*
      (* (- y) t_1)
      (fma
       (* (fma (fma (* t t) 0.020833333333333332 0.125) (* t t) 0.5) t)
       t
       1.0)))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((z * 2.0));
	double tmp;
	if ((t <= 50000000000.0) || !(t <= 9e+65)) {
		tmp = (((x * 0.5) - y) * t_1) * fma((fma(0.125, (t * t), 0.5) * t), t, 1.0);
	} else {
		tmp = (-y * t_1) * fma((fma(fma((t * t), 0.020833333333333332, 0.125), (t * t), 0.5) * t), t, 1.0);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = sqrt(Float64(z * 2.0))
	tmp = 0.0
	if ((t <= 50000000000.0) || !(t <= 9e+65))
		tmp = Float64(Float64(Float64(Float64(x * 0.5) - y) * t_1) * fma(Float64(fma(0.125, Float64(t * t), 0.5) * t), t, 1.0));
	else
		tmp = Float64(Float64(Float64(-y) * t_1) * fma(Float64(fma(fma(Float64(t * t), 0.020833333333333332, 0.125), Float64(t * t), 0.5) * t), t, 1.0));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t, 50000000000.0], N[Not[LessEqual[t, 9e+65]], $MachinePrecision]], N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[(N[(0.125 * N[(t * t), $MachinePrecision] + 0.5), $MachinePrecision] * t), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[((-y) * t$95$1), $MachinePrecision] * N[(N[(N[(N[(N[(t * t), $MachinePrecision] * 0.020833333333333332 + 0.125), $MachinePrecision] * N[(t * t), $MachinePrecision] + 0.5), $MachinePrecision] * t), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 50000000000 \lor \neg \left(t \leq 9 \cdot 10^{+65}\right):\\
\;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot t\_1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.125, t \cdot t, 0.5\right) \cdot t, t, 1\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(-y\right) \cdot t\_1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5e10 or 9e65 < t

    1. Initial program 99.0%

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

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + {t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left({t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) + \color{blue}{1}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) \cdot {t}^{2} + 1\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right), \color{blue}{{t}^{2}}, 1\right) \]
      4. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left({t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) + \frac{1}{2}, {\color{blue}{t}}^{2}, 1\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) \cdot {t}^{2} + \frac{1}{2}, {t}^{2}, 1\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}, {t}^{2}, \frac{1}{2}\right), {\color{blue}{t}}^{2}, 1\right) \]
      7. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48} \cdot {t}^{2} + \frac{1}{8}, {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, {t}^{2}, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      9. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      10. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      11. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      13. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
      14. lift-*.f6494.2

        \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot \color{blue}{t}, 1\right) \]
    5. Applied rewrites94.2%

      \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot t, 1\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
      2. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + \color{blue}{1}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      4. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      6. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t\right) \cdot t + 1\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t, \color{blue}{t}, 1\right) \]
    7. Applied rewrites94.2%

      \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, \color{blue}{t}, 1\right) \]
    8. Taylor expanded in t around 0

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{8}, t \cdot t, \frac{1}{2}\right) \cdot t, t, 1\right) \]
    9. Step-by-step derivation
      1. Applied rewrites91.0%

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

      if 5e10 < t < 9e65

      1. Initial program 92.9%

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

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + {t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left({t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) + \color{blue}{1}\right) \]
        2. *-commutativeN/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) \cdot {t}^{2} + 1\right) \]
        3. lower-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right), \color{blue}{{t}^{2}}, 1\right) \]
        4. +-commutativeN/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left({t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) + \frac{1}{2}, {\color{blue}{t}}^{2}, 1\right) \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) \cdot {t}^{2} + \frac{1}{2}, {t}^{2}, 1\right) \]
        6. lower-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}, {t}^{2}, \frac{1}{2}\right), {\color{blue}{t}}^{2}, 1\right) \]
        7. +-commutativeN/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48} \cdot {t}^{2} + \frac{1}{8}, {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
        8. lower-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, {t}^{2}, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
        9. pow2N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
        11. pow2N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
        12. lift-*.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
        13. pow2N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
        14. lift-*.f6479.1

          \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot \color{blue}{t}, 1\right) \]
      5. Applied rewrites79.1%

        \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot t, 1\right)} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
        2. lift-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + \color{blue}{1}\right) \]
        3. lift-*.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
        4. lift-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
        6. lift-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
        7. associate-*r*N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t\right) \cdot t + 1\right) \]
        8. lower-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t, \color{blue}{t}, 1\right) \]
      7. Applied rewrites79.1%

        \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, \color{blue}{t}, 1\right) \]
      8. Taylor expanded in x around 0

        \[\leadsto \left(\color{blue}{\left(-1 \cdot y\right)} \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, \frac{1}{48}, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot t, t, 1\right) \]
      9. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \left(\left(\mathsf{neg}\left(y\right)\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, \frac{1}{48}, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot t, t, 1\right) \]
        2. lift-neg.f6464.9

          \[\leadsto \left(\left(-y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right) \]
      10. Applied rewrites64.9%

        \[\leadsto \left(\color{blue}{\left(-y\right)} \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right) \]
    10. Recombined 2 regimes into one program.
    11. Final simplification89.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 50000000000 \lor \neg \left(t \leq 9 \cdot 10^{+65}\right):\\ \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.125, t \cdot t, 0.5\right) \cdot t, t, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 3: 95.3% accurate, 2.2× speedup?

    \[\begin{array}{l} \\ \left(0.5 \cdot x - y\right) \cdot \left(\sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right), t \cdot t, 1\right)\right) \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (*
      (- (* 0.5 x) y)
      (*
       (sqrt (* 2.0 z))
       (fma
        (fma (fma (* t t) 0.020833333333333332 0.125) (* t t) 0.5)
        (* t t)
        1.0))))
    double code(double x, double y, double z, double t) {
    	return ((0.5 * x) - y) * (sqrt((2.0 * z)) * fma(fma(fma((t * t), 0.020833333333333332, 0.125), (t * t), 0.5), (t * t), 1.0));
    }
    
    function code(x, y, z, t)
    	return Float64(Float64(Float64(0.5 * x) - y) * Float64(sqrt(Float64(2.0 * z)) * fma(fma(fma(Float64(t * t), 0.020833333333333332, 0.125), Float64(t * t), 0.5), Float64(t * t), 1.0)))
    end
    
    code[x_, y_, z_, t_] := N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(t * t), $MachinePrecision] * 0.020833333333333332 + 0.125), $MachinePrecision] * N[(t * t), $MachinePrecision] + 0.5), $MachinePrecision] * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left(0.5 \cdot x - y\right) \cdot \left(\sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right), t \cdot t, 1\right)\right)
    \end{array}
    
    Derivation
    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 t around 0

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + {t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left({t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) + \color{blue}{1}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) \cdot {t}^{2} + 1\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right), \color{blue}{{t}^{2}}, 1\right) \]
      4. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left({t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) + \frac{1}{2}, {\color{blue}{t}}^{2}, 1\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) \cdot {t}^{2} + \frac{1}{2}, {t}^{2}, 1\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}, {t}^{2}, \frac{1}{2}\right), {\color{blue}{t}}^{2}, 1\right) \]
      7. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48} \cdot {t}^{2} + \frac{1}{8}, {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, {t}^{2}, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      9. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      10. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      11. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      13. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
      14. lift-*.f6493.3

        \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot \color{blue}{t}, 1\right) \]
    5. Applied rewrites93.3%

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

      \[\leadsto \color{blue}{\left(0.5 \cdot x - y\right) \cdot \left(\sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right), t \cdot t, 1\right)\right)} \]
    7. Add Preprocessing

    Alternative 4: 94.8% accurate, 2.2× speedup?

    \[\begin{array}{l} \\ \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right) \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (*
      (* (- (* x 0.5) y) (sqrt (* z 2.0)))
      (fma
       (* (fma (fma (* t t) 0.020833333333333332 0.125) (* t t) 0.5) t)
       t
       1.0)))
    double code(double x, double y, double z, double t) {
    	return (((x * 0.5) - y) * sqrt((z * 2.0))) * fma((fma(fma((t * t), 0.020833333333333332, 0.125), (t * t), 0.5) * t), t, 1.0);
    }
    
    function code(x, y, z, t)
    	return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * fma(Float64(fma(fma(Float64(t * t), 0.020833333333333332, 0.125), Float64(t * t), 0.5) * t), t, 1.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[(N[(N[(N[(N[(t * t), $MachinePrecision] * 0.020833333333333332 + 0.125), $MachinePrecision] * N[(t * t), $MachinePrecision] + 0.5), $MachinePrecision] * t), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right)
    \end{array}
    
    Derivation
    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 t around 0

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + {t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left({t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) + \color{blue}{1}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) \cdot {t}^{2} + 1\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right), \color{blue}{{t}^{2}}, 1\right) \]
      4. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left({t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) + \frac{1}{2}, {\color{blue}{t}}^{2}, 1\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) \cdot {t}^{2} + \frac{1}{2}, {t}^{2}, 1\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}, {t}^{2}, \frac{1}{2}\right), {\color{blue}{t}}^{2}, 1\right) \]
      7. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48} \cdot {t}^{2} + \frac{1}{8}, {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, {t}^{2}, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      9. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      10. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      11. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      13. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
      14. lift-*.f6493.3

        \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot \color{blue}{t}, 1\right) \]
    5. Applied rewrites93.3%

      \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot t, 1\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
      2. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + \color{blue}{1}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      4. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      6. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t\right) \cdot t + 1\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t, \color{blue}{t}, 1\right) \]
    7. Applied rewrites93.3%

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

      \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, t, 1\right) \]
    9. Add Preprocessing

    Alternative 5: 86.1% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 4 \cdot 10^{+85} \lor \neg \left(t \leq 2.25 \cdot 10^{+154}\right):\\ \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (or (<= t 4e+85) (not (<= t 2.25e+154)))
       (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (fma (* t t) 0.5 1.0))
       (* (sqrt (* (fma (fma t t 2.0) (* t t) 2.0) z)) (- y))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if ((t <= 4e+85) || !(t <= 2.25e+154)) {
    		tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * fma((t * t), 0.5, 1.0);
    	} else {
    		tmp = sqrt((fma(fma(t, t, 2.0), (t * t), 2.0) * z)) * -y;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if ((t <= 4e+85) || !(t <= 2.25e+154))
    		tmp = Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * fma(Float64(t * t), 0.5, 1.0));
    	else
    		tmp = Float64(sqrt(Float64(fma(fma(t, t, 2.0), Float64(t * t), 2.0) * z)) * Float64(-y));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[Or[LessEqual[t, 4e+85], N[Not[LessEqual[t, 2.25e+154]], $MachinePrecision]], N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(N[(t * t + 2.0), $MachinePrecision] * N[(t * t), $MachinePrecision] + 2.0), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \leq 4 \cdot 10^{+85} \lor \neg \left(t \leq 2.25 \cdot 10^{+154}\right):\\
    \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < 4.0000000000000001e85 or 2.25000000000000005e154 < t

      1. Initial program 99.0%

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

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot {t}^{2}\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\frac{1}{2} \cdot {t}^{2} + \color{blue}{1}\right) \]
        2. *-commutativeN/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left({t}^{2} \cdot \frac{1}{2} + 1\right) \]
        3. lower-fma.f64N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left({t}^{2}, \color{blue}{\frac{1}{2}}, 1\right) \]
        4. pow2N/A

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \]
        5. lift-*.f6484.0

          \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right) \]
      5. Applied rewrites84.0%

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

      if 4.0000000000000001e85 < t < 2.25000000000000005e154

      1. Initial program 90.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)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\left(y \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\right) \]
        2. associate-*l*N/A

          \[\leadsto \mathsf{neg}\left(y \cdot \left(\left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{neg}\left(y \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
        4. distribute-rgt-neg-inN/A

          \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right)} \]
        5. mul-1-negN/A

          \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)}\right) \]
        6. *-commutativeN/A

          \[\leadsto \left(-1 \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \cdot \color{blue}{y} \]
        7. lower-*.f64N/A

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

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

        \[\leadsto \left(-\sqrt{2 \cdot z + {t}^{2} \cdot \left(2 \cdot z + {t}^{2} \cdot z\right)}\right) \cdot y \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(-\sqrt{{t}^{2} \cdot \left(2 \cdot z + {t}^{2} \cdot z\right) + 2 \cdot z}\right) \cdot y \]
        2. *-commutativeN/A

          \[\leadsto \left(-\sqrt{\left(2 \cdot z + {t}^{2} \cdot z\right) \cdot {t}^{2} + 2 \cdot z}\right) \cdot y \]
        3. lower-fma.f64N/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(2 \cdot z + {t}^{2} \cdot z, {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
        4. distribute-rgt-outN/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
        5. lower-*.f64N/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
        6. lower-+.f64N/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
        7. pow2N/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
        8. lift-*.f64N/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
        9. pow2N/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
        10. lift-*.f64N/A

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
        11. lift-*.f6490.3

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
      8. Applied rewrites90.3%

        \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
      9. Applied rewrites100.0%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 4 \cdot 10^{+85} \lor \neg \left(t \leq 2.25 \cdot 10^{+154}\right):\\ \;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 92.4% accurate, 2.7× speedup?

    \[\begin{array}{l} \\ \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.125, t \cdot t, 0.5\right) \cdot t, t, 1\right) \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (*
      (* (- (* x 0.5) y) (sqrt (* z 2.0)))
      (fma (* (fma 0.125 (* t t) 0.5) t) t 1.0)))
    double code(double x, double y, double z, double t) {
    	return (((x * 0.5) - y) * sqrt((z * 2.0))) * fma((fma(0.125, (t * t), 0.5) * t), t, 1.0);
    }
    
    function code(x, y, z, t)
    	return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * fma(Float64(fma(0.125, Float64(t * t), 0.5) * t), t, 1.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[(N[(N[(0.125 * N[(t * t), $MachinePrecision] + 0.5), $MachinePrecision] * t), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.125, t \cdot t, 0.5\right) \cdot t, t, 1\right)
    \end{array}
    
    Derivation
    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 t around 0

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + {t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left({t}^{2} \cdot \left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) + \color{blue}{1}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right)\right) \cdot {t}^{2} + 1\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\frac{1}{2} + {t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right), \color{blue}{{t}^{2}}, 1\right) \]
      4. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left({t}^{2} \cdot \left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) + \frac{1}{2}, {\color{blue}{t}}^{2}, 1\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}\right) \cdot {t}^{2} + \frac{1}{2}, {t}^{2}, 1\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{8} + \frac{1}{48} \cdot {t}^{2}, {t}^{2}, \frac{1}{2}\right), {\color{blue}{t}}^{2}, 1\right) \]
      7. +-commutativeN/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48} \cdot {t}^{2} + \frac{1}{8}, {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, {t}^{2}, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      9. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      10. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), {t}^{2}, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      11. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), {t}^{2}, 1\right) \]
      13. pow2N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
      14. lift-*.f6493.3

        \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot \color{blue}{t}, 1\right) \]
    5. Applied rewrites93.3%

      \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.020833333333333332, t \cdot t, 0.125\right), t \cdot t, 0.5\right), t \cdot t, 1\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right), t \cdot \color{blue}{t}, 1\right) \]
      2. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + \color{blue}{1}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right), t \cdot t, \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      4. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\mathsf{fma}\left(\frac{1}{48}, t \cdot t, \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      6. lift-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot \left(t \cdot t\right) + 1\right) \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t\right) \cdot t + 1\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\left(\left(\frac{1}{48} \cdot \left(t \cdot t\right) + \frac{1}{8}\right) \cdot \left(t \cdot t\right) + \frac{1}{2}\right) \cdot t, \color{blue}{t}, 1\right) \]
    7. Applied rewrites93.3%

      \[\leadsto \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), t \cdot t, 0.5\right) \cdot t, \color{blue}{t}, 1\right) \]
    8. Taylor expanded in t around 0

      \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{8}, t \cdot t, \frac{1}{2}\right) \cdot t, t, 1\right) \]
    9. Step-by-step derivation
      1. Applied rewrites88.1%

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

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

      Alternative 7: 68.9% accurate, 2.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\ \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+219}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot x\right) \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= t 3e-8)
         (* (sqrt (+ z z)) (fma 0.5 x (- y)))
         (if (<= t 2.4e+219)
           (* (sqrt (* (fma (fma t t 2.0) (* t t) 2.0) z)) (- y))
           (* (* 0.5 x) (* (sqrt (* z 2.0)) (fma (* t t) 0.5 1.0))))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 3e-8) {
      		tmp = sqrt((z + z)) * fma(0.5, x, -y);
      	} else if (t <= 2.4e+219) {
      		tmp = sqrt((fma(fma(t, t, 2.0), (t * t), 2.0) * z)) * -y;
      	} else {
      		tmp = (0.5 * x) * (sqrt((z * 2.0)) * fma((t * t), 0.5, 1.0));
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= 3e-8)
      		tmp = Float64(sqrt(Float64(z + z)) * fma(0.5, x, Float64(-y)));
      	elseif (t <= 2.4e+219)
      		tmp = Float64(sqrt(Float64(fma(fma(t, t, 2.0), Float64(t * t), 2.0) * z)) * Float64(-y));
      	else
      		tmp = Float64(Float64(0.5 * x) * Float64(sqrt(Float64(z * 2.0)) * fma(Float64(t * t), 0.5, 1.0)));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[t, 3e-8], N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(0.5 * x + (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+219], N[(N[Sqrt[N[(N[(N[(t * t + 2.0), $MachinePrecision] * N[(t * t), $MachinePrecision] + 2.0), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[(N[(0.5 * x), $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\
      \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\
      
      \mathbf{elif}\;t \leq 2.4 \cdot 10^{+219}:\\
      \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(0.5 \cdot x\right) \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < 2.99999999999999973e-8

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

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

            \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
          2. sqrt-prodN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
          3. *-commutativeN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
          4. lower-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
          5. lift-sqrt.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
          6. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          7. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          8. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          9. lower-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          10. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
          11. *-lft-identityN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
          12. metadata-evalN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
          13. fp-cancel-sign-sub-invN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
          14. lower-fma.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
          15. mul-1-negN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          16. lower-neg.f6467.3

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        5. Applied rewrites67.3%

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

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

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
          2. lift-neg.f6435.2

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        8. Applied rewrites35.2%

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
          2. count-2-revN/A

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
          3. lower-+.f6435.2

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        10. Applied rewrites35.2%

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        11. Taylor expanded in y around 0

          \[\leadsto \sqrt{z + z} \cdot \left(-1 \cdot y + \color{blue}{\frac{1}{2} \cdot x}\right) \]
        12. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\left(\mathsf{neg}\left(y\right)\right) + \frac{1}{2} \cdot x\right) \]
          2. +-commutativeN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\frac{1}{2} \cdot x + \left(\mathsf{neg}\left(y\right)\right)\right) \]
          3. lower-fma.f64N/A

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          4. lift-neg.f6467.3

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        13. Applied rewrites67.3%

          \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, \color{blue}{x}, -y\right) \]

        if 2.99999999999999973e-8 < t < 2.4e219

        1. Initial program 95.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)} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\left(y \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
          4. distribute-rgt-neg-inN/A

            \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right)} \]
          5. mul-1-negN/A

            \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)}\right) \]
          6. *-commutativeN/A

            \[\leadsto \left(-1 \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \cdot \color{blue}{y} \]
          7. lower-*.f64N/A

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

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

          \[\leadsto \left(-\sqrt{2 \cdot z + {t}^{2} \cdot \left(2 \cdot z + {t}^{2} \cdot z\right)}\right) \cdot y \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \left(-\sqrt{{t}^{2} \cdot \left(2 \cdot z + {t}^{2} \cdot z\right) + 2 \cdot z}\right) \cdot y \]
          2. *-commutativeN/A

            \[\leadsto \left(-\sqrt{\left(2 \cdot z + {t}^{2} \cdot z\right) \cdot {t}^{2} + 2 \cdot z}\right) \cdot y \]
          3. lower-fma.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(2 \cdot z + {t}^{2} \cdot z, {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          4. distribute-rgt-outN/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          5. lower-*.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          6. lower-+.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          7. pow2N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          8. lift-*.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          9. pow2N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
          10. lift-*.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
          11. lift-*.f6463.4

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
        8. Applied rewrites63.4%

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
        9. Applied rewrites65.4%

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

        if 2.4e219 < 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. Step-by-step derivation
          1. lift-exp.f64N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{e^{\frac{t \cdot t}{2}}} \]
          2. lift-*.f64N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{\color{blue}{t \cdot t}}{2}} \]
          3. lift-/.f64N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{\frac{t \cdot t}{2}}} \]
          4. pow2N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{\color{blue}{{t}^{2}}}{2}} \]
          5. exp-sqrtN/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\sqrt{e^{{t}^{2}}}} \]
          6. pow1/2N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{{\left(e^{{t}^{2}}\right)}^{\frac{1}{2}}} \]
          7. exp-prodN/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{e^{{t}^{2} \cdot \frac{1}{2}}} \]
          8. *-commutativeN/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{\frac{1}{2} \cdot {t}^{2}}} \]
          9. lower-exp.f64N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{e^{\frac{1}{2} \cdot {t}^{2}}} \]
          10. *-commutativeN/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{{t}^{2} \cdot \frac{1}{2}}} \]
          11. lower-*.f64N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{{t}^{2} \cdot \frac{1}{2}}} \]
          12. pow2N/A

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\color{blue}{\left(t \cdot t\right)} \cdot \frac{1}{2}} \]
          13. lift-*.f64100.0

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

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

          \[\leadsto \left(\color{blue}{\left(\frac{1}{2} \cdot x\right)} \cdot \sqrt{z \cdot 2}\right) \cdot e^{\left(t \cdot t\right) \cdot \frac{1}{2}} \]
        6. Step-by-step derivation
          1. lower-*.f6484.2

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

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

          \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot {t}^{2}\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(\frac{1}{2} \cdot {t}^{2} + \color{blue}{1}\right) \]
          2. *-commutativeN/A

            \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left({t}^{2} \cdot \frac{1}{2} + 1\right) \]
          3. lower-fma.f64N/A

            \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left({t}^{2}, \color{blue}{\frac{1}{2}}, 1\right) \]
          4. pow2N/A

            \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \]
          5. lift-*.f6484.2

            \[\leadsto \left(\left(0.5 \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right) \]
        10. Applied rewrites84.2%

          \[\leadsto \left(\left(0.5 \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \color{blue}{\mathsf{fma}\left(t \cdot t, 0.5, 1\right)} \]
        11. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right)} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{z \cdot 2}\right)} \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \]
          3. lift-*.f64N/A

            \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \sqrt{\color{blue}{z \cdot 2}}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \]
          4. lift-sqrt.f64N/A

            \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \color{blue}{\sqrt{z \cdot 2}}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \]
          5. sqrt-prodN/A

            \[\leadsto \left(\left(\frac{1}{2} \cdot x\right) \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{2}\right)}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \]
          6. associate-*l*N/A

            \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot x\right) \cdot \left(\left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right)\right)} \]
          7. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot x\right) \cdot \left(\left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right)\right)} \]
          8. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{2} \cdot x\right) \cdot \color{blue}{\left(\left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right)\right)} \]
          9. sqrt-prodN/A

            \[\leadsto \left(\frac{1}{2} \cdot x\right) \cdot \left(\color{blue}{\sqrt{z \cdot 2}} \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right)\right) \]
          10. lift-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{2} \cdot x\right) \cdot \left(\color{blue}{\sqrt{z \cdot 2}} \cdot \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right)\right) \]
          11. lift-*.f6489.5

            \[\leadsto \left(0.5 \cdot x\right) \cdot \left(\sqrt{\color{blue}{z \cdot 2}} \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\right) \]
        12. Applied rewrites89.5%

          \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\right)} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification68.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\ \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+219}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot x\right) \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{fma}\left(t \cdot t, 0.5, 1\right)\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 69.1% accurate, 3.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\ \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= t 3e-8)
         (* (sqrt (+ z z)) (fma 0.5 x (- y)))
         (* (sqrt (* (fma (fma t t 2.0) (* t t) 2.0) z)) (- y))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 3e-8) {
      		tmp = sqrt((z + z)) * fma(0.5, x, -y);
      	} else {
      		tmp = sqrt((fma(fma(t, t, 2.0), (t * t), 2.0) * z)) * -y;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= 3e-8)
      		tmp = Float64(sqrt(Float64(z + z)) * fma(0.5, x, Float64(-y)));
      	else
      		tmp = Float64(sqrt(Float64(fma(fma(t, t, 2.0), Float64(t * t), 2.0) * z)) * Float64(-y));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[t, 3e-8], N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(0.5 * x + (-y)), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(N[(t * t + 2.0), $MachinePrecision] * N[(t * t), $MachinePrecision] + 2.0), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\
      \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z} \cdot \left(-y\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < 2.99999999999999973e-8

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

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

            \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
          2. sqrt-prodN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
          3. *-commutativeN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
          4. lower-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
          5. lift-sqrt.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
          6. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          7. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          8. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          9. lower-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          10. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
          11. *-lft-identityN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
          12. metadata-evalN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
          13. fp-cancel-sign-sub-invN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
          14. lower-fma.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
          15. mul-1-negN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          16. lower-neg.f6467.3

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        5. Applied rewrites67.3%

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

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

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
          2. lift-neg.f6435.2

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        8. Applied rewrites35.2%

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
          2. count-2-revN/A

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
          3. lower-+.f6435.2

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        10. Applied rewrites35.2%

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        11. Taylor expanded in y around 0

          \[\leadsto \sqrt{z + z} \cdot \left(-1 \cdot y + \color{blue}{\frac{1}{2} \cdot x}\right) \]
        12. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\left(\mathsf{neg}\left(y\right)\right) + \frac{1}{2} \cdot x\right) \]
          2. +-commutativeN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\frac{1}{2} \cdot x + \left(\mathsf{neg}\left(y\right)\right)\right) \]
          3. lower-fma.f64N/A

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          4. lift-neg.f6467.3

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        13. Applied rewrites67.3%

          \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, \color{blue}{x}, -y\right) \]

        if 2.99999999999999973e-8 < t

        1. Initial program 97.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)} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\left(y \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
          4. distribute-rgt-neg-inN/A

            \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right)} \]
          5. mul-1-negN/A

            \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)}\right) \]
          6. *-commutativeN/A

            \[\leadsto \left(-1 \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \cdot \color{blue}{y} \]
          7. lower-*.f64N/A

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

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

          \[\leadsto \left(-\sqrt{2 \cdot z + {t}^{2} \cdot \left(2 \cdot z + {t}^{2} \cdot z\right)}\right) \cdot y \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \left(-\sqrt{{t}^{2} \cdot \left(2 \cdot z + {t}^{2} \cdot z\right) + 2 \cdot z}\right) \cdot y \]
          2. *-commutativeN/A

            \[\leadsto \left(-\sqrt{\left(2 \cdot z + {t}^{2} \cdot z\right) \cdot {t}^{2} + 2 \cdot z}\right) \cdot y \]
          3. lower-fma.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(2 \cdot z + {t}^{2} \cdot z, {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          4. distribute-rgt-outN/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          5. lower-*.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          6. lower-+.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + {t}^{2}\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          7. pow2N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          8. lift-*.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), {t}^{2}, 2 \cdot z\right)}\right) \cdot y \]
          9. pow2N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
          10. lift-*.f64N/A

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
          11. lift-*.f6464.8

            \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
        8. Applied rewrites64.8%

          \[\leadsto \left(-\sqrt{\mathsf{fma}\left(z \cdot \left(2 + t \cdot t\right), t \cdot t, 2 \cdot z\right)}\right) \cdot y \]
        9. Applied rewrites66.2%

          \[\leadsto \color{blue}{\left(-\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t, t, 2\right), t \cdot t, 2\right) \cdot z}\right) \cdot y} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification67.0%

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

      Alternative 9: 66.3% accurate, 3.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\ \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(z + \left(t \cdot t\right) \cdot z\right)} \cdot \left(-y\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= t 3e-8)
         (* (sqrt (+ z z)) (fma 0.5 x (- y)))
         (* (sqrt (* 2.0 (+ z (* (* t t) z)))) (- y))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 3e-8) {
      		tmp = sqrt((z + z)) * fma(0.5, x, -y);
      	} else {
      		tmp = sqrt((2.0 * (z + ((t * t) * z)))) * -y;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= 3e-8)
      		tmp = Float64(sqrt(Float64(z + z)) * fma(0.5, x, Float64(-y)));
      	else
      		tmp = Float64(sqrt(Float64(2.0 * Float64(z + Float64(Float64(t * t) * z)))) * Float64(-y));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[t, 3e-8], N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(0.5 * x + (-y)), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(z + N[(N[(t * t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\
      \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{2 \cdot \left(z + \left(t \cdot t\right) \cdot z\right)} \cdot \left(-y\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < 2.99999999999999973e-8

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

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

            \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
          2. sqrt-prodN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
          3. *-commutativeN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
          4. lower-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
          5. lift-sqrt.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
          6. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          7. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          8. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          9. lower-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          10. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
          11. *-lft-identityN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
          12. metadata-evalN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
          13. fp-cancel-sign-sub-invN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
          14. lower-fma.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
          15. mul-1-negN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          16. lower-neg.f6467.3

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        5. Applied rewrites67.3%

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

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

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
          2. lift-neg.f6435.2

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        8. Applied rewrites35.2%

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
          2. count-2-revN/A

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
          3. lower-+.f6435.2

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        10. Applied rewrites35.2%

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        11. Taylor expanded in y around 0

          \[\leadsto \sqrt{z + z} \cdot \left(-1 \cdot y + \color{blue}{\frac{1}{2} \cdot x}\right) \]
        12. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\left(\mathsf{neg}\left(y\right)\right) + \frac{1}{2} \cdot x\right) \]
          2. +-commutativeN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\frac{1}{2} \cdot x + \left(\mathsf{neg}\left(y\right)\right)\right) \]
          3. lower-fma.f64N/A

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          4. lift-neg.f6467.3

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        13. Applied rewrites67.3%

          \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, \color{blue}{x}, -y\right) \]

        if 2.99999999999999973e-8 < t

        1. Initial program 97.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)} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\left(y \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
          4. distribute-rgt-neg-inN/A

            \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right)} \]
          5. mul-1-negN/A

            \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)}\right) \]
          6. *-commutativeN/A

            \[\leadsto \left(-1 \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \cdot \color{blue}{y} \]
          7. lower-*.f64N/A

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

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

          \[\leadsto \left(-\sqrt{2 \cdot z + 2 \cdot \left({t}^{2} \cdot z\right)}\right) \cdot y \]
        7. Step-by-step derivation
          1. distribute-lft-outN/A

            \[\leadsto \left(-\sqrt{2 \cdot \left(z + {t}^{2} \cdot z\right)}\right) \cdot y \]
          2. lower-*.f64N/A

            \[\leadsto \left(-\sqrt{2 \cdot \left(z + {t}^{2} \cdot z\right)}\right) \cdot y \]
          3. lower-+.f64N/A

            \[\leadsto \left(-\sqrt{2 \cdot \left(z + {t}^{2} \cdot z\right)}\right) \cdot y \]
          4. lower-*.f64N/A

            \[\leadsto \left(-\sqrt{2 \cdot \left(z + {t}^{2} \cdot z\right)}\right) \cdot y \]
          5. pow2N/A

            \[\leadsto \left(-\sqrt{2 \cdot \left(z + \left(t \cdot t\right) \cdot z\right)}\right) \cdot y \]
          6. lift-*.f6450.5

            \[\leadsto \left(-\sqrt{2 \cdot \left(z + \left(t \cdot t\right) \cdot z\right)}\right) \cdot y \]
        8. Applied rewrites50.5%

          \[\leadsto \left(-\sqrt{2 \cdot \left(z + \left(t \cdot t\right) \cdot z\right)}\right) \cdot y \]
      3. Recombined 2 regimes into one program.
      4. Final simplification62.9%

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

      Alternative 10: 66.3% accurate, 3.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\ \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \cdot \left(-y\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= t 3e-8)
         (* (sqrt (+ z z)) (fma 0.5 x (- y)))
         (* (sqrt (* (* 2.0 z) (fma t t 1.0))) (- y))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 3e-8) {
      		tmp = sqrt((z + z)) * fma(0.5, x, -y);
      	} else {
      		tmp = sqrt(((2.0 * z) * fma(t, t, 1.0))) * -y;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= 3e-8)
      		tmp = Float64(sqrt(Float64(z + z)) * fma(0.5, x, Float64(-y)));
      	else
      		tmp = Float64(sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0))) * Float64(-y));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[t, 3e-8], N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(0.5 * x + (-y)), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 3 \cdot 10^{-8}:\\
      \;\;\;\;\sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \cdot \left(-y\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < 2.99999999999999973e-8

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

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

            \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
          2. sqrt-prodN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
          3. *-commutativeN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
          4. lower-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
          5. lift-sqrt.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
          6. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          7. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          8. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          9. lower-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          10. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
          11. *-lft-identityN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
          12. metadata-evalN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
          13. fp-cancel-sign-sub-invN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
          14. lower-fma.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
          15. mul-1-negN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          16. lower-neg.f6467.3

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        5. Applied rewrites67.3%

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

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

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
          2. lift-neg.f6435.2

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        8. Applied rewrites35.2%

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
          2. count-2-revN/A

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
          3. lower-+.f6435.2

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        10. Applied rewrites35.2%

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        11. Taylor expanded in y around 0

          \[\leadsto \sqrt{z + z} \cdot \left(-1 \cdot y + \color{blue}{\frac{1}{2} \cdot x}\right) \]
        12. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\left(\mathsf{neg}\left(y\right)\right) + \frac{1}{2} \cdot x\right) \]
          2. +-commutativeN/A

            \[\leadsto \sqrt{z + z} \cdot \left(\frac{1}{2} \cdot x + \left(\mathsf{neg}\left(y\right)\right)\right) \]
          3. lower-fma.f64N/A

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          4. lift-neg.f6467.3

            \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        13. Applied rewrites67.3%

          \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, \color{blue}{x}, -y\right) \]

        if 2.99999999999999973e-8 < t

        1. Initial program 97.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)} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\left(y \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right) \cdot \sqrt{z}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(y \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
          4. distribute-rgt-neg-inN/A

            \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right)} \]
          5. mul-1-negN/A

            \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)}\right) \]
          6. *-commutativeN/A

            \[\leadsto \left(-1 \cdot \left(\sqrt{z} \cdot \left(e^{\frac{1}{2} \cdot {t}^{2}} \cdot \sqrt{2}\right)\right)\right) \cdot \color{blue}{y} \]
          7. lower-*.f64N/A

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

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

          \[\leadsto \left(-\sqrt{\left(2 \cdot z\right) \cdot \left(1 + {t}^{2}\right)}\right) \cdot y \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \left(-\sqrt{\left(2 \cdot z\right) \cdot \left({t}^{2} + 1\right)}\right) \cdot y \]
          2. pow2N/A

            \[\leadsto \left(-\sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}\right) \cdot y \]
          3. lower-fma.f6450.5

            \[\leadsto \left(-\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\right) \cdot y \]
        8. Applied rewrites50.5%

          \[\leadsto \left(-\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\right) \cdot y \]
      3. Recombined 2 regimes into one program.
      4. Final simplification62.9%

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

      Alternative 11: 42.8% accurate, 4.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z + z}\\ \mathbf{if}\;x \leq -8 \cdot 10^{+50} \lor \neg \left(x \leq 1.4 \cdot 10^{-38}\right):\\ \;\;\;\;t\_1 \cdot \left(0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(-y\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (sqrt (+ z z))))
         (if (or (<= x -8e+50) (not (<= x 1.4e-38)))
           (* t_1 (* 0.5 x))
           (* t_1 (- y)))))
      double code(double x, double y, double z, double t) {
      	double t_1 = sqrt((z + z));
      	double tmp;
      	if ((x <= -8e+50) || !(x <= 1.4e-38)) {
      		tmp = t_1 * (0.5 * x);
      	} else {
      		tmp = t_1 * -y;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t)
      use fmin_fmax_functions
          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 + z))
          if ((x <= (-8d+50)) .or. (.not. (x <= 1.4d-38))) then
              tmp = t_1 * (0.5d0 * x)
          else
              tmp = t_1 * -y
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = Math.sqrt((z + z));
      	double tmp;
      	if ((x <= -8e+50) || !(x <= 1.4e-38)) {
      		tmp = t_1 * (0.5 * x);
      	} else {
      		tmp = t_1 * -y;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = math.sqrt((z + z))
      	tmp = 0
      	if (x <= -8e+50) or not (x <= 1.4e-38):
      		tmp = t_1 * (0.5 * x)
      	else:
      		tmp = t_1 * -y
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = sqrt(Float64(z + z))
      	tmp = 0.0
      	if ((x <= -8e+50) || !(x <= 1.4e-38))
      		tmp = Float64(t_1 * Float64(0.5 * x));
      	else
      		tmp = Float64(t_1 * Float64(-y));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = sqrt((z + z));
      	tmp = 0.0;
      	if ((x <= -8e+50) || ~((x <= 1.4e-38)))
      		tmp = t_1 * (0.5 * x);
      	else
      		tmp = t_1 * -y;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -8e+50], N[Not[LessEqual[x, 1.4e-38]], $MachinePrecision]], N[(t$95$1 * N[(0.5 * x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * (-y)), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \sqrt{z + z}\\
      \mathbf{if}\;x \leq -8 \cdot 10^{+50} \lor \neg \left(x \leq 1.4 \cdot 10^{-38}\right):\\
      \;\;\;\;t\_1 \cdot \left(0.5 \cdot x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1 \cdot \left(-y\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -8.0000000000000006e50 or 1.4e-38 < 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. Add Preprocessing
        3. Taylor expanded in t around 0

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

            \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
          2. sqrt-prodN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
          3. *-commutativeN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
          4. lower-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
          5. lift-sqrt.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
          6. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          7. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          8. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          9. lower-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          10. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
          11. *-lft-identityN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
          12. metadata-evalN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
          13. fp-cancel-sign-sub-invN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
          14. lower-fma.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
          15. mul-1-negN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          16. lower-neg.f6457.0

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        5. Applied rewrites57.0%

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

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

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
          2. lift-neg.f6412.6

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

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
          2. count-2-revN/A

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
          3. lower-+.f6412.6

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        10. Applied rewrites12.6%

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        11. Taylor expanded in x around inf

          \[\leadsto \sqrt{z + z} \cdot \left(\frac{1}{2} \cdot \color{blue}{x}\right) \]
        12. Step-by-step derivation
          1. lift-*.f6446.5

            \[\leadsto \sqrt{z + z} \cdot \left(0.5 \cdot x\right) \]
        13. Applied rewrites46.5%

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

        if -8.0000000000000006e50 < x < 1.4e-38

        1. Initial program 97.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 t around 0

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

            \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
          2. sqrt-prodN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
          3. *-commutativeN/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
          4. lower-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
          5. lift-sqrt.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
          6. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          7. lift-*.f64N/A

            \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          8. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          9. lower-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
          10. *-commutativeN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
          11. *-lft-identityN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
          12. metadata-evalN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
          13. fp-cancel-sign-sub-invN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
          14. lower-fma.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
          15. mul-1-negN/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
          16. lower-neg.f6451.2

            \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
        5. Applied rewrites51.2%

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

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

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
          2. lift-neg.f6441.4

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        8. Applied rewrites41.4%

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
          2. count-2-revN/A

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
          3. lower-+.f6441.4

            \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        10. Applied rewrites41.4%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+50} \lor \neg \left(x \leq 1.4 \cdot 10^{-38}\right):\\ \;\;\;\;\sqrt{z + z} \cdot \left(0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{z + z} \cdot \left(-y\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 12: 56.6% accurate, 5.6× speedup?

      \[\begin{array}{l} \\ \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \end{array} \]
      (FPCore (x y z t) :precision binary64 (* (sqrt (+ z z)) (fma 0.5 x (- y))))
      double code(double x, double y, double z, double t) {
      	return sqrt((z + z)) * fma(0.5, x, -y);
      }
      
      function code(x, y, z, t)
      	return Float64(sqrt(Float64(z + z)) * fma(0.5, x, Float64(-y)))
      end
      
      code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(0.5 * x + (-y)), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right)
      \end{array}
      
      Derivation
      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 t around 0

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

          \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
        2. sqrt-prodN/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
        3. *-commutativeN/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
        4. lower-*.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
        5. lift-sqrt.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
        6. lift-*.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        7. lift-*.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        8. *-commutativeN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        9. lower-*.f64N/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        10. *-commutativeN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
        11. *-lft-identityN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
        12. metadata-evalN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
        13. fp-cancel-sign-sub-invN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
        14. lower-fma.f64N/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
        15. mul-1-negN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
        16. lower-neg.f6453.7

          \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
      5. Applied rewrites53.7%

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

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

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
        2. lift-neg.f6429.0

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
      8. Applied rewrites29.0%

        \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        2. count-2-revN/A

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        3. lower-+.f6429.0

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
      10. Applied rewrites29.0%

        \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
      11. Taylor expanded in y around 0

        \[\leadsto \sqrt{z + z} \cdot \left(-1 \cdot y + \color{blue}{\frac{1}{2} \cdot x}\right) \]
      12. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \sqrt{z + z} \cdot \left(\left(\mathsf{neg}\left(y\right)\right) + \frac{1}{2} \cdot x\right) \]
        2. +-commutativeN/A

          \[\leadsto \sqrt{z + z} \cdot \left(\frac{1}{2} \cdot x + \left(\mathsf{neg}\left(y\right)\right)\right) \]
        3. lower-fma.f64N/A

          \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
        4. lift-neg.f6453.7

          \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
      13. Applied rewrites53.7%

        \[\leadsto \sqrt{z + z} \cdot \mathsf{fma}\left(0.5, \color{blue}{x}, -y\right) \]
      14. Add Preprocessing

      Alternative 13: 29.4% accurate, 7.1× speedup?

      \[\begin{array}{l} \\ \sqrt{z + z} \cdot \left(-y\right) \end{array} \]
      (FPCore (x y z t) :precision binary64 (* (sqrt (+ z z)) (- y)))
      double code(double x, double y, double z, double t) {
      	return sqrt((z + z)) * -y;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = sqrt((z + z)) * -y
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return Math.sqrt((z + z)) * -y;
      }
      
      def code(x, y, z, t):
      	return math.sqrt((z + z)) * -y
      
      function code(x, y, z, t)
      	return Float64(sqrt(Float64(z + z)) * Float64(-y))
      end
      
      function tmp = code(x, y, z, t)
      	tmp = sqrt((z + z)) * -y;
      end
      
      code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \sqrt{z + z} \cdot \left(-y\right)
      \end{array}
      
      Derivation
      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 t around 0

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

          \[\leadsto \left(\sqrt{z} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot x - y\right)} \]
        2. sqrt-prodN/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{\frac{1}{2} \cdot x} - y\right) \]
        3. *-commutativeN/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2} - y\right) \]
        4. lower-*.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \color{blue}{\left(x \cdot \frac{1}{2} - y\right)} \]
        5. lift-sqrt.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x \cdot \frac{1}{2}} - y\right) \]
        6. lift-*.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        7. lift-*.f64N/A

          \[\leadsto \sqrt{z \cdot 2} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        8. *-commutativeN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        9. lower-*.f64N/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\color{blue}{x} \cdot \frac{1}{2} - y\right) \]
        10. *-commutativeN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - y\right) \]
        11. *-lft-identityN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - 1 \cdot \color{blue}{y}\right) \]
        12. metadata-evalN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right) \]
        13. fp-cancel-sign-sub-invN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\frac{1}{2} \cdot x + \color{blue}{-1 \cdot y}\right) \]
        14. lower-fma.f64N/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x}, -1 \cdot y\right) \]
        15. mul-1-negN/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(\frac{1}{2}, x, \mathsf{neg}\left(y\right)\right) \]
        16. lower-neg.f6453.7

          \[\leadsto \sqrt{2 \cdot z} \cdot \mathsf{fma}\left(0.5, x, -y\right) \]
      5. Applied rewrites53.7%

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

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

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
        2. lift-neg.f6429.0

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
      8. Applied rewrites29.0%

        \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \sqrt{2 \cdot z} \cdot \left(-y\right) \]
        2. count-2-revN/A

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
        3. lower-+.f6429.0

          \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
      10. Applied rewrites29.0%

        \[\leadsto \sqrt{z + z} \cdot \left(-y\right) \]
      11. Add Preprocessing

      Developer Target 1: 99.4% 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));
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t)
      use fmin_fmax_functions
          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 2025051 
      (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))))