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

Percentage Accurate: 99.4% → 99.8%
Time: 6.1s
Alternatives: 11
Speedup: 1.1×

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 11 alternatives:

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

Initial Program: 99.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.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
    16. lower-exp.f6499.8

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

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

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

      \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
    20. lower-+.f6499.8

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

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

Alternative 2: 77.5% accurate, 1.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{t \cdot t} \cdot z}\\


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

    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 rewrites56.5%

        \[\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 \color{blue}{\left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right)} \cdot 1 \]
        2. *-commutativeN/A

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

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

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

          \[\leadsto \left(\sqrt{z \cdot 2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(y\right)\right) + x \cdot \frac{1}{2}\right)}\right) \cdot 1 \]
        6. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\sqrt{z + z}, -y, \color{blue}{\sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2}\right)}\right) \cdot 1 \]
        15. lower-*.f6456.2

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

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

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

          \[\leadsto \mathsf{fma}\left(\sqrt{z + z}, -y, \sqrt{\color{blue}{z + z}} \cdot \left(x \cdot \frac{1}{2}\right)\right) \cdot 1 \]
        19. lift-+.f6456.2

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

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

      if 0.059999999999999998 < 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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
        16. lower-exp.f6499.8

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

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

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

          \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
        20. lower-+.f6499.8

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

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

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

    Alternative 3: 71.2% accurate, 1.2× speedup?

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

      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 rewrites56.5%

          \[\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 \color{blue}{\left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right)} \cdot 1 \]
          2. *-commutativeN/A

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

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

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

            \[\leadsto \left(\sqrt{z \cdot 2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(y\right)\right) + x \cdot \frac{1}{2}\right)}\right) \cdot 1 \]
          6. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\sqrt{z + z}, -y, \color{blue}{\sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2}\right)}\right) \cdot 1 \]
          15. lower-*.f6456.2

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

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

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

            \[\leadsto \mathsf{fma}\left(\sqrt{z + z}, -y, \sqrt{\color{blue}{z + z}} \cdot \left(x \cdot \frac{1}{2}\right)\right) \cdot 1 \]
          19. lift-+.f6456.2

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

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

        if 0.0035999999999999999 < 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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
          16. lower-exp.f6499.8

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

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

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

            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
          20. lower-+.f6499.8

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

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

          \[\leadsto \color{blue}{\left(-1 \cdot y\right)} \cdot \sqrt{e^{t \cdot t} \cdot \left(z + z\right)} \]
        5. Step-by-step derivation
          1. lower-*.f6463.2

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

          \[\leadsto \color{blue}{\left(-1 \cdot y\right)} \cdot \sqrt{e^{t \cdot t} \cdot \left(z + z\right)} \]
        7. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

            \[\leadsto \sqrt{e^{t \cdot t} \cdot \left(z + z\right)} \cdot \left(\mathsf{neg}\left(y\right)\right) \]
          6. lower-neg.f6463.2

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

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

      Alternative 4: 58.7% accurate, 1.2× speedup?

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

        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 rewrites56.5%

            \[\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 \color{blue}{\left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right)} \cdot 1 \]
            2. *-commutativeN/A

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

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

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

              \[\leadsto \left(\sqrt{z \cdot 2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(y\right)\right) + x \cdot \frac{1}{2}\right)}\right) \cdot 1 \]
            6. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\sqrt{z + z}, -y, \color{blue}{\sqrt{z \cdot 2} \cdot \left(x \cdot \frac{1}{2}\right)}\right) \cdot 1 \]
            15. lower-*.f6456.2

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

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

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

              \[\leadsto \mathsf{fma}\left(\sqrt{z + z}, -y, \sqrt{\color{blue}{z + z}} \cdot \left(x \cdot \frac{1}{2}\right)\right) \cdot 1 \]
            19. lift-+.f6456.2

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

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

          if 700 < 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. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
            16. lower-exp.f6499.8

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

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

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

              \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
            20. lower-+.f6499.8

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

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

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

            \[\leadsto \left(x \cdot \frac{1}{2} - y\right) \cdot \color{blue}{\sqrt{z}} \]
          6. Step-by-step derivation
            1. lower-sqrt.f6422.7

              \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z} \]
          7. Applied rewrites22.7%

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

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

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

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

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

              \[\leadsto \left(-1 \cdot \left(x \cdot \left(\frac{y}{x} - 0.5\right)\right)\right) \cdot \sqrt{z} \]
          10. Applied rewrites26.4%

            \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot \left(\frac{y}{x} - 0.5\right)\right)\right)} \cdot \sqrt{z} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 5: 58.4% accurate, 1.6× speedup?

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

          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 rewrites56.5%

              \[\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 \color{blue}{\left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1} \]
              2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            if 700 < 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. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
              16. lower-exp.f6499.8

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

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

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

                \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
              20. lower-+.f6499.8

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

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

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

              \[\leadsto \left(x \cdot \frac{1}{2} - y\right) \cdot \color{blue}{\sqrt{z}} \]
            6. Step-by-step derivation
              1. lower-sqrt.f6422.7

                \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z} \]
            7. Applied rewrites22.7%

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

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

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

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

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

                \[\leadsto \left(-1 \cdot \left(x \cdot \left(\frac{y}{x} - 0.5\right)\right)\right) \cdot \sqrt{z} \]
            10. Applied rewrites26.4%

              \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot \left(\frac{y}{x} - 0.5\right)\right)\right)} \cdot \sqrt{z} \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 6: 56.5% accurate, 2.0× speedup?

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

            \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
          2. 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 rewrites56.5%

              \[\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 \color{blue}{\left(\left(x \cdot \frac{1}{2} - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot 1} \]
              2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            Alternative 7: 42.9% accurate, 1.4× speedup?

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

              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 rewrites56.5%

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

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

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

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

                    \[\leadsto \left(-1 \cdot \left(y \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                  4. lower-*.f6429.2

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

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

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

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

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

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

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

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

                    \[\leadsto \left(\sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                  8. pow1/2N/A

                    \[\leadsto \left({\left(2 \cdot z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                  9. lift-*.f64N/A

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

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

                    \[\leadsto \left({\left(2 \cdot z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                  12. count-2-revN/A

                    \[\leadsto \left({\left(z + z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                  13. lift-+.f64N/A

                    \[\leadsto \left({\left(z + z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                  14. pow1/2N/A

                    \[\leadsto \left(\sqrt{z + z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                  15. lift-sqrt.f64N/A

                    \[\leadsto \left(\sqrt{z + z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                  16. lower-neg.f6429.2

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

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

                if -3.5e37 < y < 2.1e82

                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 rewrites56.5%

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

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

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

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

                      \[\leadsto \left(\frac{1}{2} \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                    4. lower-*.f6429.8

                      \[\leadsto \left(0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                  4. Applied rewrites29.8%

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

                  if 2.1e82 < y

                  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 rewrites56.5%

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

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

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

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

                        \[\leadsto \left(-1 \cdot \left(y \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                      4. lower-*.f6429.2

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(\left(\mathsf{neg}\left(z \cdot \sqrt{\frac{2}{z}}\right)\right) \cdot y\right) \cdot 1 \]
                      7. lower-neg.f6429.2

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

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

                        \[\leadsto \left(\left(-\sqrt{\frac{2}{z}} \cdot z\right) \cdot y\right) \cdot 1 \]
                      10. lower-*.f6429.2

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

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

                  Alternative 8: 42.9% accurate, 1.5× speedup?

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

                    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 rewrites56.5%

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

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

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

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

                          \[\leadsto \left(-1 \cdot \left(y \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                        4. lower-*.f6429.2

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

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

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

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

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

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

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

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

                          \[\leadsto \left(\sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                        8. pow1/2N/A

                          \[\leadsto \left({\left(2 \cdot z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                        9. lift-*.f64N/A

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

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

                          \[\leadsto \left({\left(2 \cdot z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                        12. count-2-revN/A

                          \[\leadsto \left({\left(z + z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                        13. lift-+.f64N/A

                          \[\leadsto \left({\left(z + z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                        14. pow1/2N/A

                          \[\leadsto \left(\sqrt{z + z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                        15. lift-sqrt.f64N/A

                          \[\leadsto \left(\sqrt{z + z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                        16. lower-neg.f6429.2

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

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

                      if -3.5e37 < y < 1.06000000000000006e82

                      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 rewrites56.5%

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

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

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

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

                            \[\leadsto \left(\frac{1}{2} \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                          4. lower-*.f6429.8

                            \[\leadsto \left(0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                        4. Applied rewrites29.8%

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

                      Alternative 9: 35.7% accurate, 1.7× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot 0.5 - y\right) \cdot \sqrt{z}\\ \mathbf{if}\;x \leq -1.45 \cdot 10^{+178}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{+151}:\\ \;\;\;\;\left(\sqrt{z + z} \cdot \left(-y\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (let* ((t_1 (* (- (* x 0.5) y) (sqrt z))))
                         (if (<= x -1.45e+178)
                           t_1
                           (if (<= x 3.7e+151) (* (* (sqrt (+ z z)) (- y)) 1.0) t_1))))
                      double code(double x, double y, double z, double t) {
                      	double t_1 = ((x * 0.5) - y) * sqrt(z);
                      	double tmp;
                      	if (x <= -1.45e+178) {
                      		tmp = t_1;
                      	} else if (x <= 3.7e+151) {
                      		tmp = (sqrt((z + z)) * -y) * 1.0;
                      	} else {
                      		tmp = t_1;
                      	}
                      	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 = ((x * 0.5d0) - y) * sqrt(z)
                          if (x <= (-1.45d+178)) then
                              tmp = t_1
                          else if (x <= 3.7d+151) then
                              tmp = (sqrt((z + z)) * -y) * 1.0d0
                          else
                              tmp = t_1
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double t_1 = ((x * 0.5) - y) * Math.sqrt(z);
                      	double tmp;
                      	if (x <= -1.45e+178) {
                      		tmp = t_1;
                      	} else if (x <= 3.7e+151) {
                      		tmp = (Math.sqrt((z + z)) * -y) * 1.0;
                      	} else {
                      		tmp = t_1;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	t_1 = ((x * 0.5) - y) * math.sqrt(z)
                      	tmp = 0
                      	if x <= -1.45e+178:
                      		tmp = t_1
                      	elif x <= 3.7e+151:
                      		tmp = (math.sqrt((z + z)) * -y) * 1.0
                      	else:
                      		tmp = t_1
                      	return tmp
                      
                      function code(x, y, z, t)
                      	t_1 = Float64(Float64(Float64(x * 0.5) - y) * sqrt(z))
                      	tmp = 0.0
                      	if (x <= -1.45e+178)
                      		tmp = t_1;
                      	elseif (x <= 3.7e+151)
                      		tmp = Float64(Float64(sqrt(Float64(z + z)) * Float64(-y)) * 1.0);
                      	else
                      		tmp = t_1;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	t_1 = ((x * 0.5) - y) * sqrt(z);
                      	tmp = 0.0;
                      	if (x <= -1.45e+178)
                      		tmp = t_1;
                      	elseif (x <= 3.7e+151)
                      		tmp = (sqrt((z + z)) * -y) * 1.0;
                      	else
                      		tmp = t_1;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+178], t$95$1, If[LessEqual[x, 3.7e+151], N[(N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision] * 1.0), $MachinePrecision], t$95$1]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \left(x \cdot 0.5 - y\right) \cdot \sqrt{z}\\
                      \mathbf{if}\;x \leq -1.45 \cdot 10^{+178}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;x \leq 3.7 \cdot 10^{+151}:\\
                      \;\;\;\;\left(\sqrt{z + z} \cdot \left(-y\right)\right) \cdot 1\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if x < -1.45e178 or 3.6999999999999997e151 < 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. Step-by-step derivation
                          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
                          16. lower-exp.f6499.8

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

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

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

                            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
                          20. lower-+.f6499.8

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

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

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

                          \[\leadsto \left(x \cdot \frac{1}{2} - y\right) \cdot \color{blue}{\sqrt{z}} \]
                        6. Step-by-step derivation
                          1. lower-sqrt.f6422.7

                            \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z} \]
                        7. Applied rewrites22.7%

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

                        if -1.45e178 < x < 3.6999999999999997e151

                        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 rewrites56.5%

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

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

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

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

                              \[\leadsto \left(-1 \cdot \left(y \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1 \]
                            4. lower-*.f6429.2

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

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

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

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

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

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

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

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

                              \[\leadsto \left(\sqrt{2 \cdot z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                            8. pow1/2N/A

                              \[\leadsto \left({\left(2 \cdot z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                            9. lift-*.f64N/A

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

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

                              \[\leadsto \left({\left(2 \cdot z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                            12. count-2-revN/A

                              \[\leadsto \left({\left(z + z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                            13. lift-+.f64N/A

                              \[\leadsto \left({\left(z + z\right)}^{\frac{1}{2}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \cdot 1 \]
                            14. pow1/2N/A

                              \[\leadsto \left(\sqrt{z + z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                            15. lift-sqrt.f64N/A

                              \[\leadsto \left(\sqrt{z + z} \cdot \left(\mathsf{neg}\left(\color{blue}{y}\right)\right)\right) \cdot 1 \]
                            16. lower-neg.f6429.2

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

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

                        Alternative 10: 22.7% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
                          16. lower-exp.f6499.8

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

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

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

                            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
                          20. lower-+.f6499.8

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

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

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

                          \[\leadsto \left(x \cdot \frac{1}{2} - y\right) \cdot \color{blue}{\sqrt{z}} \]
                        6. Step-by-step derivation
                          1. lower-sqrt.f6422.7

                            \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z} \]
                        7. Applied rewrites22.7%

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

                        Alternative 11: 13.1% accurate, 3.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{\color{blue}{e^{t \cdot t} \cdot \left(z \cdot 2\right)}} \]
                          16. lower-exp.f6499.8

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

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

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

                            \[\leadsto \left(\frac{1}{2} \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \color{blue}{\left(z + z\right)}} \]
                          20. lower-+.f6499.8

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

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

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

                          \[\leadsto \left(x \cdot \frac{1}{2} - y\right) \cdot \color{blue}{\sqrt{z}} \]
                        6. Step-by-step derivation
                          1. lower-sqrt.f6422.7

                            \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{z} \]
                        7. Applied rewrites22.7%

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

                          \[\leadsto \color{blue}{\left(-1 \cdot y\right)} \cdot \sqrt{z} \]
                        9. Step-by-step derivation
                          1. lower-*.f6413.1

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

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

                        Reproduce

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