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

Percentage Accurate: 99.4% → 99.4%
Time: 5.0s
Alternatives: 12
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}

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 12 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^{\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}
Derivation
  1. Initial program 99.4%

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

Alternative 2: 90.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z + z} \cdot \left(\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(0.5 \cdot x - y\right)\right)\\ t_2 := \sqrt{\left(z + z\right) \cdot e^{t \cdot t}}\\ \mathbf{if}\;t \leq 0.18:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+25}:\\ \;\;\;\;\left(t\_2 \cdot x\right) \cdot 0.5\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+99}:\\ \;\;\;\;\left(-t\_2\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (sqrt (+ z z)) (* (fma (* t t) 0.5 1.0) (- (* 0.5 x) y))))
        (t_2 (sqrt (* (+ z z) (exp (* t t))))))
   (if (<= t 0.18)
     t_1
     (if (<= t 5e+25)
       (* (* t_2 x) 0.5)
       (if (<= t 2.6e+99) (* (- t_2) y) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((z + z)) * (fma((t * t), 0.5, 1.0) * ((0.5 * x) - y));
	double t_2 = sqrt(((z + z) * exp((t * t))));
	double tmp;
	if (t <= 0.18) {
		tmp = t_1;
	} else if (t <= 5e+25) {
		tmp = (t_2 * x) * 0.5;
	} else if (t <= 2.6e+99) {
		tmp = -t_2 * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(sqrt(Float64(z + z)) * Float64(fma(Float64(t * t), 0.5, 1.0) * Float64(Float64(0.5 * x) - y)))
	t_2 = sqrt(Float64(Float64(z + z) * exp(Float64(t * t))))
	tmp = 0.0
	if (t <= 0.18)
		tmp = t_1;
	elseif (t <= 5e+25)
		tmp = Float64(Float64(t_2 * x) * 0.5);
	elseif (t <= 2.6e+99)
		tmp = Float64(Float64(-t_2) * y);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(t * t), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(z + z), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.18], t$95$1, If[LessEqual[t, 5e+25], N[(N[(t$95$2 * x), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t, 2.6e+99], N[((-t$95$2) * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{z + z} \cdot \left(\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(0.5 \cdot x - y\right)\right)\\
t_2 := \sqrt{\left(z + z\right) \cdot e^{t \cdot t}}\\
\mathbf{if}\;t \leq 0.18:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\left(t\_2 \cdot x\right) \cdot 0.5\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+99}:\\
\;\;\;\;\left(-t\_2\right) \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 0.17999999999999999 or 2.6e99 < t

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(1 + \frac{1}{2} \cdot {t}^{2}\right) \cdot \left(\frac{1}{2} \cdot x - y\right)\right) \cdot \sqrt{z + z} \]
      13. count-2-revN/A

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

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

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

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

    if 0.17999999999999999 < t < 5.00000000000000024e25

    1. Initial program 99.4%

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

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

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

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

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

    if 5.00000000000000024e25 < t < 2.6e99

    1. Initial program 99.4%

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

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

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

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

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

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

Alternative 3: 87.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.5 \cdot x - y\\ t_2 := \sqrt{z + z}\\ \mathbf{if}\;t \leq 9.2 \cdot 10^{-26}:\\ \;\;\;\;t\_1 \cdot t\_2\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+99}:\\ \;\;\;\;\left(-\sqrt{\left(z + z\right) \cdot e^{t \cdot t}}\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot \left(\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* 0.5 x) y)) (t_2 (sqrt (+ z z))))
   (if (<= t 9.2e-26)
     (* t_1 t_2)
     (if (<= t 2.6e+99)
       (* (- (sqrt (* (+ z z) (exp (* t t))))) y)
       (* t_2 (* (fma (* t t) 0.5 1.0) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (0.5 * x) - y;
	double t_2 = sqrt((z + z));
	double tmp;
	if (t <= 9.2e-26) {
		tmp = t_1 * t_2;
	} else if (t <= 2.6e+99) {
		tmp = -sqrt(((z + z) * exp((t * t)))) * y;
	} else {
		tmp = t_2 * (fma((t * t), 0.5, 1.0) * t_1);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(0.5 * x) - y)
	t_2 = sqrt(Float64(z + z))
	tmp = 0.0
	if (t <= 9.2e-26)
		tmp = Float64(t_1 * t_2);
	elseif (t <= 2.6e+99)
		tmp = Float64(Float64(-sqrt(Float64(Float64(z + z) * exp(Float64(t * t))))) * y);
	else
		tmp = Float64(t_2 * Float64(fma(Float64(t * t), 0.5, 1.0) * t_1));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 9.2e-26], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t, 2.6e+99], N[((-N[Sqrt[N[(N[(z + z), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * y), $MachinePrecision], N[(t$95$2 * N[(N[(N[(t * t), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 0.5 \cdot x - y\\
t_2 := \sqrt{z + z}\\
\mathbf{if}\;t \leq 9.2 \cdot 10^{-26}:\\
\;\;\;\;t\_1 \cdot t\_2\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+99}:\\
\;\;\;\;\left(-\sqrt{\left(z + z\right) \cdot e^{t \cdot t}}\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 9.20000000000000035e-26

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{\sqrt{\left(z + z\right) \cdot \color{blue}{\left(z + z\right)}}}\right) \cdot 1 \]
        10. lift-+.f6446.4

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

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

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

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

      if 9.20000000000000035e-26 < t < 2.6e99

      1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\sqrt{\left(z + z\right) \cdot e^{t \cdot t}}\right) \cdot y} \]

      if 2.6e99 < t

      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(1 + \frac{1}{2} \cdot {t}^{2}\right) \cdot \left(\frac{1}{2} \cdot x - y\right)\right) \cdot \sqrt{z + z} \]
        13. count-2-revN/A

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

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

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

        \[\leadsto \sqrt{z + z} \cdot \color{blue}{\left(\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(0.5 \cdot x - y\right)\right)} \]
    4. Recombined 3 regimes into one program.
    5. Add Preprocessing

    Alternative 4: 74.8% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(1 + \frac{1}{2} \cdot {t}^{2}\right) \cdot \left(\frac{1}{2} \cdot x - y\right)\right) \cdot \sqrt{z + z} \]
      13. count-2-revN/A

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

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

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

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

    Alternative 5: 67.1% accurate, 1.1× speedup?

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

      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{\sqrt{\left(z + z\right) \cdot \color{blue}{\left(z + z\right)}}}\right) \cdot 1 \]
          10. lift-+.f6446.4

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

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

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

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

        if 6.20000000000000011e48 < t < 3.31999999999999988e273

        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z + z}\right)} \]
        5. Taylor expanded in x around inf

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \cdot \left(\left(\sqrt{2 \cdot z} \cdot x\right) \cdot \frac{1}{2}\right) \]
          6. count-2-revN/A

            \[\leadsto \mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \cdot \left(\left(\sqrt{z + z} \cdot x\right) \cdot \frac{1}{2}\right) \]
          7. lift-+.f6450.0

            \[\leadsto \mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(\left(\sqrt{z + z} \cdot x\right) \cdot 0.5\right) \]
        7. Applied rewrites50.0%

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

        if 3.31999999999999988e273 < t

        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-\sqrt{\left(z + z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\right) \cdot y \]
      4. Recombined 3 regimes into one program.
      5. Add Preprocessing

      Alternative 6: 66.7% accurate, 1.1× speedup?

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

        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{\sqrt{\left(z + z\right) \cdot \color{blue}{\left(z + z\right)}}}\right) \cdot 1 \]
            10. lift-+.f6446.4

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

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

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

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

          if 6.20000000000000011e48 < t < 3.31999999999999988e273

          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z + z}\right)} \]
          5. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\left(\mathsf{fma}\left(t \cdot t, \frac{1}{2}, 1\right) \cdot \sqrt{2 \cdot z}\right) \cdot x\right) \cdot \frac{1}{2} \]
            13. count-2-revN/A

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

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

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

          if 3.31999999999999988e273 < t

          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-\sqrt{\left(z + z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\right) \cdot y \]
        4. Recombined 3 regimes into one program.
        5. Add Preprocessing

        Alternative 7: 66.2% accurate, 1.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z + z}\\ \mathbf{if}\;t \leq 6.5 \cdot 10^{+29}:\\ \;\;\;\;\left(0.5 \cdot x - y\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{\left(t \cdot t\right) \cdot z}{t\_1}\right) \cdot y\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (sqrt (+ z z))))
           (if (<= t 6.5e+29)
             (* (- (* 0.5 x) y) t_1)
             (* (- (/ (* (* t t) z) t_1)) y))))
        double code(double x, double y, double z, double t) {
        	double t_1 = sqrt((z + z));
        	double tmp;
        	if (t <= 6.5e+29) {
        		tmp = ((0.5 * x) - y) * t_1;
        	} else {
        		tmp = -(((t * t) * z) / 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 (t <= 6.5d+29) then
                tmp = ((0.5d0 * x) - y) * t_1
            else
                tmp = -(((t * t) * z) / 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 (t <= 6.5e+29) {
        		tmp = ((0.5 * x) - y) * t_1;
        	} else {
        		tmp = -(((t * t) * z) / t_1) * y;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = math.sqrt((z + z))
        	tmp = 0
        	if t <= 6.5e+29:
        		tmp = ((0.5 * x) - y) * t_1
        	else:
        		tmp = -(((t * t) * z) / t_1) * y
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = sqrt(Float64(z + z))
        	tmp = 0.0
        	if (t <= 6.5e+29)
        		tmp = Float64(Float64(Float64(0.5 * x) - y) * t_1);
        	else
        		tmp = Float64(Float64(-Float64(Float64(Float64(t * t) * z) / t_1)) * y);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = sqrt((z + z));
        	tmp = 0.0;
        	if (t <= 6.5e+29)
        		tmp = ((0.5 * x) - y) * t_1;
        	else
        		tmp = -(((t * t) * z) / 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[LessEqual[t, 6.5e+29], N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[((-N[(N[(N[(t * t), $MachinePrecision] * z), $MachinePrecision] / t$95$1), $MachinePrecision]) * y), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \sqrt{z + z}\\
        \mathbf{if}\;t \leq 6.5 \cdot 10^{+29}:\\
        \;\;\;\;\left(0.5 \cdot x - y\right) \cdot t\_1\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(-\frac{\left(t \cdot t\right) \cdot z}{t\_1}\right) \cdot y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < 6.49999999999999971e29

          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{\sqrt{\left(z + z\right) \cdot \color{blue}{\left(z + z\right)}}}\right) \cdot 1 \]
              10. lift-+.f6446.4

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

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

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

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

            if 6.49999999999999971e29 < t

            1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-\mathsf{fma}\left(t \cdot t, \frac{z}{\sqrt{2 \cdot z}}, \sqrt{2 \cdot z}\right)\right) \cdot y \]
              8. count-2-revN/A

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

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

                \[\leadsto \left(-\mathsf{fma}\left(t \cdot t, \frac{z}{\sqrt{z + z}}, \sqrt{2 \cdot z}\right)\right) \cdot y \]
              11. count-2-revN/A

                \[\leadsto \left(-\mathsf{fma}\left(t \cdot t, \frac{z}{\sqrt{z + z}}, \sqrt{z + z}\right)\right) \cdot y \]
              12. lift-+.f6451.2

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

              \[\leadsto \left(-\mathsf{fma}\left(t \cdot t, \frac{z}{\sqrt{z + z}}, \sqrt{z + z}\right)\right) \cdot y \]
            8. Taylor expanded in t around inf

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

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

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

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

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

                \[\leadsto \left(-\frac{\left(t \cdot t\right) \cdot z}{\sqrt{z + z}}\right) \cdot y \]
              6. lift-sqrt.f64N/A

                \[\leadsto \left(-\frac{\left(t \cdot t\right) \cdot z}{\sqrt{z + z}}\right) \cdot y \]
              7. lift-+.f6429.3

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

              \[\leadsto \left(-\frac{\left(t \cdot t\right) \cdot z}{\sqrt{z + z}}\right) \cdot y \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 8: 65.5% accurate, 1.6× speedup?

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

            1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{\sqrt{\left(z + z\right) \cdot \color{blue}{\left(z + z\right)}}}\right) \cdot 1 \]
                10. lift-+.f6446.4

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

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

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

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

              if 1.69999999999999995e126 < t

              1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-\sqrt{\left(z + z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\right) \cdot y \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 9: 58.3% accurate, 1.6× speedup?

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

              1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{\sqrt{\left(z + z\right) \cdot \color{blue}{\left(z + z\right)}}}\right) \cdot 1 \]
                  10. lift-+.f6446.4

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

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

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

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

                if 4.0000000000000002e206 < t

                1. Initial program 99.4%

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

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

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

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

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

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

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

                    \[\leadsto \left(\mathsf{neg}\left(\sqrt{2 \cdot z}\right)\right) \cdot y \]
                  2. lower-neg.f64N/A

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

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

                    \[\leadsto \left(-\sqrt{z + z}\right) \cdot y \]
                  5. lift-+.f6429.9

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

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

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

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

                    \[\leadsto \left(-\sqrt{{\left(2 \cdot z\right)}^{1}}\right) \cdot y \]
                  4. metadata-evalN/A

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

                    \[\leadsto \left(-\sqrt{{\left(\sqrt{2 \cdot z}\right)}^{2}}\right) \cdot y \]
                  6. rem-square-sqrtN/A

                    \[\leadsto \left(-\sqrt{\sqrt{{\left(\sqrt{2 \cdot z}\right)}^{2}} \cdot \sqrt{{\left(\sqrt{2 \cdot z}\right)}^{2}}}\right) \cdot y \]
                  7. sqrt-unprodN/A

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

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

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

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

                    \[\leadsto \left(-\sqrt{\sqrt{{\left(z + z\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\sqrt{2 \cdot z}\right)}^{2}}}\right) \cdot y \]
                  12. metadata-evalN/A

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

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

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

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

                    \[\leadsto \left(-\sqrt{\sqrt{\left(z + z\right) \cdot {\left(z + z\right)}^{\left(\frac{2}{2}\right)}}}\right) \cdot y \]
                  17. metadata-evalN/A

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

                    \[\leadsto \left(-\sqrt{\sqrt{\left(z + z\right) \cdot \left(z + z\right)}}\right) \cdot y \]
                  19. lift-+.f6428.5

                    \[\leadsto \left(-\sqrt{\sqrt{\left(z + z\right) \cdot \left(z + z\right)}}\right) \cdot y \]
                9. Applied rewrites28.5%

                  \[\leadsto \left(-\sqrt{\sqrt{\left(z + z\right) \cdot \left(z + z\right)}}\right) \cdot y \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 10: 57.8% accurate, 2.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{\sqrt{\left(z + z\right) \cdot \color{blue}{\left(z + z\right)}}}\right) \cdot 1 \]
                  10. lift-+.f6446.4

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

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

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

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

                Alternative 11: 43.5% accurate, 1.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{z + z}\\ t_2 := \left(t\_1 \cdot x\right) \cdot 0.5\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+64}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-29}:\\ \;\;\;\;\left(-t\_1\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (let* ((t_1 (sqrt (+ z z))) (t_2 (* (* t_1 x) 0.5)))
                   (if (<= x -3.2e+64) t_2 (if (<= x 2.2e-29) (* (- t_1) y) t_2))))
                double code(double x, double y, double z, double t) {
                	double t_1 = sqrt((z + z));
                	double t_2 = (t_1 * x) * 0.5;
                	double tmp;
                	if (x <= -3.2e+64) {
                		tmp = t_2;
                	} else if (x <= 2.2e-29) {
                		tmp = -t_1 * y;
                	} else {
                		tmp = t_2;
                	}
                	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) :: t_2
                    real(8) :: tmp
                    t_1 = sqrt((z + z))
                    t_2 = (t_1 * x) * 0.5d0
                    if (x <= (-3.2d+64)) then
                        tmp = t_2
                    else if (x <= 2.2d-29) then
                        tmp = -t_1 * y
                    else
                        tmp = t_2
                    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 t_2 = (t_1 * x) * 0.5;
                	double tmp;
                	if (x <= -3.2e+64) {
                		tmp = t_2;
                	} else if (x <= 2.2e-29) {
                		tmp = -t_1 * y;
                	} else {
                		tmp = t_2;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	t_1 = math.sqrt((z + z))
                	t_2 = (t_1 * x) * 0.5
                	tmp = 0
                	if x <= -3.2e+64:
                		tmp = t_2
                	elif x <= 2.2e-29:
                		tmp = -t_1 * y
                	else:
                		tmp = t_2
                	return tmp
                
                function code(x, y, z, t)
                	t_1 = sqrt(Float64(z + z))
                	t_2 = Float64(Float64(t_1 * x) * 0.5)
                	tmp = 0.0
                	if (x <= -3.2e+64)
                		tmp = t_2;
                	elseif (x <= 2.2e-29)
                		tmp = Float64(Float64(-t_1) * y);
                	else
                		tmp = t_2;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t)
                	t_1 = sqrt((z + z));
                	t_2 = (t_1 * x) * 0.5;
                	tmp = 0.0;
                	if (x <= -3.2e+64)
                		tmp = t_2;
                	elseif (x <= 2.2e-29)
                		tmp = -t_1 * y;
                	else
                		tmp = t_2;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * x), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[x, -3.2e+64], t$95$2, If[LessEqual[x, 2.2e-29], N[((-t$95$1) * y), $MachinePrecision], t$95$2]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \sqrt{z + z}\\
                t_2 := \left(t\_1 \cdot x\right) \cdot 0.5\\
                \mathbf{if}\;x \leq -3.2 \cdot 10^{+64}:\\
                \;\;\;\;t\_2\\
                
                \mathbf{elif}\;x \leq 2.2 \cdot 10^{-29}:\\
                \;\;\;\;\left(-t\_1\right) \cdot y\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_2\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -3.20000000000000019e64 or 2.1999999999999999e-29 < x

                  1. Initial program 99.4%

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

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

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

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

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

                    \[\leadsto \left(x \cdot \sqrt{2 \cdot z}\right) \cdot \frac{1}{2} \]
                  6. Step-by-step derivation
                    1. *-commutativeN/A

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

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

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

                      \[\leadsto \left(\sqrt{z + z} \cdot x\right) \cdot \frac{1}{2} \]
                    5. lift-+.f6430.4

                      \[\leadsto \left(\sqrt{z + z} \cdot x\right) \cdot 0.5 \]
                  7. Applied rewrites30.4%

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

                  if -3.20000000000000019e64 < x < 2.1999999999999999e-29

                  1. Initial program 99.4%

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

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

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

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

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

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

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

                      \[\leadsto \left(\mathsf{neg}\left(\sqrt{2 \cdot z}\right)\right) \cdot y \]
                    2. lower-neg.f64N/A

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

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

                      \[\leadsto \left(-\sqrt{z + z}\right) \cdot y \]
                    5. lift-+.f6429.9

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

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

                Alternative 12: 29.9% accurate, 3.6× speedup?

                \[\begin{array}{l} \\ \left(-\sqrt{z + z}\right) \cdot y \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(Float64(-sqrt(Float64(z + z))) * 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}
                
                \\
                \left(-\sqrt{z + z}\right) \cdot y
                \end{array}
                
                Derivation
                1. Initial program 99.4%

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

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

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

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

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

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

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

                    \[\leadsto \left(\mathsf{neg}\left(\sqrt{2 \cdot z}\right)\right) \cdot y \]
                  2. lower-neg.f64N/A

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

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

                    \[\leadsto \left(-\sqrt{z + z}\right) \cdot y \]
                  5. lift-+.f6429.9

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

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

                Reproduce

                ?
                herbie shell --seed 2025142 
                (FPCore (x y z t)
                  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
                  :precision binary64
                  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))