Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2

Percentage Accurate: 83.2% → 97.5%
Time: 2.6s
Alternatives: 10
Speedup: 0.7×

Specification

?
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
(FPCore (x y z)
  :precision binary64
  (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
	return (x * y) / ((z * z) * (z + 1.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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
	return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z):
	return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z)
	return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0)))
end
function tmp = code(x, y, z)
	tmp = (x * y) / ((z * z) * (z + 1.0));
end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}

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 10 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: 83.2% accurate, 1.0× speedup?

\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
(FPCore (x y z)
  :precision binary64
  (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
	return (x * y) / ((z * z) * (z + 1.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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
	return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z):
	return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z)
	return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0)))
end
function tmp = code(x, y, z)
	tmp = (x * y) / ((z * z) * (z + 1.0));
end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}

Alternative 1: 97.5% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{t\_1 \cdot t\_0}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 5 \cdot 10^{-300}:\\ \;\;\;\;\frac{\frac{t\_0}{\left(z - -1\right) \cdot z}}{z} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t\_0 \cdot \frac{t\_1}{z}}{z - -1}}{z}\\ \end{array}\right) \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (fmax (fabs x) (fabs y))) (t_1 (fmin (fabs x) (fabs y))))
  (*
   (copysign 1.0 x)
   (*
    (copysign 1.0 y)
    (if (<= (/ (* t_1 t_0) (* (* z z) (+ z 1.0))) 5e-300)
      (* (/ (/ t_0 (* (- z -1.0) z)) z) t_1)
      (/ (/ (* t_0 (/ t_1 z)) (- z -1.0)) z))))))
double code(double x, double y, double z) {
	double t_0 = fmax(fabs(x), fabs(y));
	double t_1 = fmin(fabs(x), fabs(y));
	double tmp;
	if (((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 5e-300) {
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1;
	} else {
		tmp = ((t_0 * (t_1 / z)) / (z - -1.0)) / z;
	}
	return copysign(1.0, x) * (copysign(1.0, y) * tmp);
}
public static double code(double x, double y, double z) {
	double t_0 = fmax(Math.abs(x), Math.abs(y));
	double t_1 = fmin(Math.abs(x), Math.abs(y));
	double tmp;
	if (((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 5e-300) {
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1;
	} else {
		tmp = ((t_0 * (t_1 / z)) / (z - -1.0)) / z;
	}
	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * tmp);
}
def code(x, y, z):
	t_0 = fmax(math.fabs(x), math.fabs(y))
	t_1 = fmin(math.fabs(x), math.fabs(y))
	tmp = 0
	if ((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 5e-300:
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1
	else:
		tmp = ((t_0 * (t_1 / z)) / (z - -1.0)) / z
	return math.copysign(1.0, x) * (math.copysign(1.0, y) * tmp)
function code(x, y, z)
	t_0 = fmax(abs(x), abs(y))
	t_1 = fmin(abs(x), abs(y))
	tmp = 0.0
	if (Float64(Float64(t_1 * t_0) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 5e-300)
		tmp = Float64(Float64(Float64(t_0 / Float64(Float64(z - -1.0) * z)) / z) * t_1);
	else
		tmp = Float64(Float64(Float64(t_0 * Float64(t_1 / z)) / Float64(z - -1.0)) / z);
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * tmp))
end
function tmp_2 = code(x, y, z)
	t_0 = max(abs(x), abs(y));
	t_1 = min(abs(x), abs(y));
	tmp = 0.0;
	if (((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 5e-300)
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1;
	else
		tmp = ((t_0 * (t_1 / z)) / (z - -1.0)) / z;
	end
	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * tmp);
end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(t$95$1 * t$95$0), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-300], N[(N[(N[(t$95$0 / N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(t$95$0 * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / N[(z - -1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\
t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_1 \cdot t\_0}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 5 \cdot 10^{-300}:\\
\;\;\;\;\frac{\frac{t\_0}{\left(z - -1\right) \cdot z}}{z} \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0 \cdot \frac{t\_1}{z}}{z - -1}}{z}\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))) < 5e-300

    1. Initial program 83.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
      6. lower-/.f6485.0%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\left(\left(z + 1\right) \cdot z\right)} \cdot z} \cdot x \]
      13. lower-*.f6485.0%

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

        \[\leadsto \frac{y}{\left(\color{blue}{\left(z + 1\right)} \cdot z\right) \cdot z} \cdot x \]
      15. add-flipN/A

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

        \[\leadsto \frac{y}{\left(\color{blue}{\left(z - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z\right) \cdot z} \cdot x \]
      17. metadata-eval85.0%

        \[\leadsto \frac{y}{\left(\left(z - \color{blue}{-1}\right) \cdot z\right) \cdot z} \cdot x \]
    3. Applied rewrites85.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(z - -1\right) \cdot z}}}{z} \cdot x \]
      5. lower-/.f6490.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{\left(z - -1\right) \cdot z}}{z}} \cdot x \]
    5. Applied rewrites90.7%

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

    if 5e-300 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))))

    1. Initial program 83.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
      12. associate-/l*N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      14. lower-/.f6496.2%

        \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
      15. lift-+.f64N/A

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
      16. add-flipN/A

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

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
      18. metadata-eval96.2%

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
    3. Applied rewrites96.2%

      \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 96.2% accurate, 0.1× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+29}:\\ \;\;\;\;\frac{\frac{\frac{t\_0}{z} \cdot t\_1}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0}{\left(z - -1\right) \cdot z} \cdot \frac{t\_1}{z}\\ \end{array}\right) \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (fmax (fabs x) (fabs y))) (t_1 (fmin (fabs x) (fabs y))))
  (*
   (copysign 1.0 x)
   (*
    (copysign 1.0 y)
    (if (<= z -1.1e+29)
      (/ (/ (* (/ t_0 z) t_1) z) z)
      (* (/ t_0 (* (- z -1.0) z)) (/ t_1 z)))))))
double code(double x, double y, double z) {
	double t_0 = fmax(fabs(x), fabs(y));
	double t_1 = fmin(fabs(x), fabs(y));
	double tmp;
	if (z <= -1.1e+29) {
		tmp = (((t_0 / z) * t_1) / z) / z;
	} else {
		tmp = (t_0 / ((z - -1.0) * z)) * (t_1 / z);
	}
	return copysign(1.0, x) * (copysign(1.0, y) * tmp);
}
public static double code(double x, double y, double z) {
	double t_0 = fmax(Math.abs(x), Math.abs(y));
	double t_1 = fmin(Math.abs(x), Math.abs(y));
	double tmp;
	if (z <= -1.1e+29) {
		tmp = (((t_0 / z) * t_1) / z) / z;
	} else {
		tmp = (t_0 / ((z - -1.0) * z)) * (t_1 / z);
	}
	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * tmp);
}
def code(x, y, z):
	t_0 = fmax(math.fabs(x), math.fabs(y))
	t_1 = fmin(math.fabs(x), math.fabs(y))
	tmp = 0
	if z <= -1.1e+29:
		tmp = (((t_0 / z) * t_1) / z) / z
	else:
		tmp = (t_0 / ((z - -1.0) * z)) * (t_1 / z)
	return math.copysign(1.0, x) * (math.copysign(1.0, y) * tmp)
function code(x, y, z)
	t_0 = fmax(abs(x), abs(y))
	t_1 = fmin(abs(x), abs(y))
	tmp = 0.0
	if (z <= -1.1e+29)
		tmp = Float64(Float64(Float64(Float64(t_0 / z) * t_1) / z) / z);
	else
		tmp = Float64(Float64(t_0 / Float64(Float64(z - -1.0) * z)) * Float64(t_1 / z));
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * tmp))
end
function tmp_2 = code(x, y, z)
	t_0 = max(abs(x), abs(y));
	t_1 = min(abs(x), abs(y));
	tmp = 0.0;
	if (z <= -1.1e+29)
		tmp = (((t_0 / z) * t_1) / z) / z;
	else
		tmp = (t_0 / ((z - -1.0) * z)) * (t_1 / z);
	end
	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * tmp);
end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[z, -1.1e+29], N[(N[(N[(N[(t$95$0 / z), $MachinePrecision] * t$95$1), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(t$95$0 / N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\
t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{\frac{t\_0}{z} \cdot t\_1}{z}}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(z - -1\right) \cdot z} \cdot \frac{t\_1}{z}\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.1000000000000001e29

    1. Initial program 83.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
      12. associate-/l*N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      14. lower-/.f6496.2%

        \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
      15. lift-+.f64N/A

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
      16. add-flipN/A

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

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
      18. metadata-eval96.2%

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
    3. Applied rewrites96.2%

      \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z - -1}}{z} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{z} \cdot y}}{z - -1}}{z} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z} \cdot \frac{y}{z - -1}}}{z} \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\frac{y}{z - -1}}{z}} \]
      7. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{\frac{y}{z - -1}}{z} \]
      8. frac-timesN/A

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{z - -1}}{z \cdot z}} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{x \cdot \frac{y}{z - -1}}{\color{blue}{z \cdot z}} \]
      10. associate-/l*N/A

        \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{z - -1}}}{z \cdot z} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{x \cdot y}}{z - -1}}{z \cdot z} \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z - -1}}{z \cdot z}} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{x \cdot y}}{z - -1}}{z \cdot z} \]
      14. *-commutativeN/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{z - -1}}{z \cdot z} \]
      15. associate-*l/N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{z - -1} \cdot x}}{z \cdot z} \]
      16. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{z - -1} \cdot x}}{z \cdot z} \]
      17. lower-/.f6487.9%

        \[\leadsto \frac{\color{blue}{\frac{y}{z - -1}} \cdot x}{z \cdot z} \]
    5. Applied rewrites87.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{z - -1} \cdot x}{z \cdot z}} \]
    6. Taylor expanded in z around inf

      \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{z}}}{z \cdot z} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{\color{blue}{z}}}{z \cdot z} \]
      2. lower-*.f6457.8%

        \[\leadsto \frac{\frac{x \cdot y}{z}}{z \cdot z} \]
    8. Applied rewrites57.8%

      \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{z}}}{z \cdot z} \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z}}{z \cdot z}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{z}}{\color{blue}{z \cdot z}} \]
      3. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z}}{z}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z}}{z}} \]
      5. lower-/.f6458.6%

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z}}}{z} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{z}}}{z}}{z} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{x \cdot y}{z}}{z}}{z} \]
      8. associate-/l*N/A

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\frac{y}{z}}}{z}}{z} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot \frac{y}{\color{blue}{z}}}{z}}{z} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{y}{z} \cdot \color{blue}{x}}{z}}{z} \]
      11. lower-*.f6462.4%

        \[\leadsto \frac{\frac{\frac{y}{z} \cdot \color{blue}{x}}{z}}{z} \]
    10. Applied rewrites62.4%

      \[\leadsto \color{blue}{\frac{\frac{\frac{y}{z} \cdot x}{z}}{z}} \]

    if -1.1000000000000001e29 < z

    1. Initial program 83.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
      12. associate-/l*N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      14. lower-/.f6496.2%

        \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
      15. lift-+.f64N/A

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
      16. add-flipN/A

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

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
      18. metadata-eval96.2%

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
    3. Applied rewrites96.2%

      \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
      3. associate-/l/N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z}} \cdot \frac{x}{z} \]
      8. lower-*.f6494.1%

        \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z} \cdot \frac{x}{z}} \]
    5. Applied rewrites94.1%

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

Alternative 3: 95.6% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{t\_1 \cdot t\_0}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\frac{\frac{t\_0}{\left(z - -1\right) \cdot z}}{z} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(-t\_0\right) \cdot \frac{\frac{t\_1}{z}}{\left(-1 - z\right) \cdot z}\\ \end{array}\right) \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (fmax (fabs x) (fabs y))) (t_1 (fmin (fabs x) (fabs y))))
  (*
   (copysign 1.0 x)
   (*
    (copysign 1.0 y)
    (if (<= (/ (* t_1 t_0) (* (* z z) (+ z 1.0))) 2e+52)
      (* (/ (/ t_0 (* (- z -1.0) z)) z) t_1)
      (* (- t_0) (/ (/ t_1 z) (* (- -1.0 z) z))))))))
double code(double x, double y, double z) {
	double t_0 = fmax(fabs(x), fabs(y));
	double t_1 = fmin(fabs(x), fabs(y));
	double tmp;
	if (((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 2e+52) {
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1;
	} else {
		tmp = -t_0 * ((t_1 / z) / ((-1.0 - z) * z));
	}
	return copysign(1.0, x) * (copysign(1.0, y) * tmp);
}
public static double code(double x, double y, double z) {
	double t_0 = fmax(Math.abs(x), Math.abs(y));
	double t_1 = fmin(Math.abs(x), Math.abs(y));
	double tmp;
	if (((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 2e+52) {
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1;
	} else {
		tmp = -t_0 * ((t_1 / z) / ((-1.0 - z) * z));
	}
	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * tmp);
}
def code(x, y, z):
	t_0 = fmax(math.fabs(x), math.fabs(y))
	t_1 = fmin(math.fabs(x), math.fabs(y))
	tmp = 0
	if ((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 2e+52:
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1
	else:
		tmp = -t_0 * ((t_1 / z) / ((-1.0 - z) * z))
	return math.copysign(1.0, x) * (math.copysign(1.0, y) * tmp)
function code(x, y, z)
	t_0 = fmax(abs(x), abs(y))
	t_1 = fmin(abs(x), abs(y))
	tmp = 0.0
	if (Float64(Float64(t_1 * t_0) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 2e+52)
		tmp = Float64(Float64(Float64(t_0 / Float64(Float64(z - -1.0) * z)) / z) * t_1);
	else
		tmp = Float64(Float64(-t_0) * Float64(Float64(t_1 / z) / Float64(Float64(-1.0 - z) * z)));
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * tmp))
end
function tmp_2 = code(x, y, z)
	t_0 = max(abs(x), abs(y));
	t_1 = min(abs(x), abs(y));
	tmp = 0.0;
	if (((t_1 * t_0) / ((z * z) * (z + 1.0))) <= 2e+52)
		tmp = ((t_0 / ((z - -1.0) * z)) / z) * t_1;
	else
		tmp = -t_0 * ((t_1 / z) / ((-1.0 - z) * z));
	end
	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * tmp);
end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(t$95$1 * t$95$0), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+52], N[(N[(N[(t$95$0 / N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * t$95$1), $MachinePrecision], N[((-t$95$0) * N[(N[(t$95$1 / z), $MachinePrecision] / N[(N[(-1.0 - z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\
t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_1 \cdot t\_0}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{t\_0}{\left(z - -1\right) \cdot z}}{z} \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(-t\_0\right) \cdot \frac{\frac{t\_1}{z}}{\left(-1 - z\right) \cdot z}\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))) < 2e52

    1. Initial program 83.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
      6. lower-/.f6485.0%

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\left(\left(z + 1\right) \cdot z\right)} \cdot z} \cdot x \]
      13. lower-*.f6485.0%

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

        \[\leadsto \frac{y}{\left(\color{blue}{\left(z + 1\right)} \cdot z\right) \cdot z} \cdot x \]
      15. add-flipN/A

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

        \[\leadsto \frac{y}{\left(\color{blue}{\left(z - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z\right) \cdot z} \cdot x \]
      17. metadata-eval85.0%

        \[\leadsto \frac{y}{\left(\left(z - \color{blue}{-1}\right) \cdot z\right) \cdot z} \cdot x \]
    3. Applied rewrites85.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(z - -1\right) \cdot z}}}{z} \cdot x \]
      5. lower-/.f6490.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{\left(z - -1\right) \cdot z}}{z}} \cdot x \]
    5. Applied rewrites90.7%

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

    if 2e52 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))))

    1. Initial program 83.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
      12. associate-/l*N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      14. lower-/.f6496.2%

        \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
      15. lift-+.f64N/A

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
      16. add-flipN/A

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

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
      18. metadata-eval96.2%

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
    3. Applied rewrites96.2%

      \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
      3. associate-/l/N/A

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{y \cdot \frac{x}{z}}\right)}{\mathsf{neg}\left(\left(z - -1\right) \cdot z\right)} \]
      7. distribute-lft-neg-inN/A

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

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

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

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

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

        \[\leadsto \left(-y\right) \cdot \frac{\frac{x}{z}}{\mathsf{neg}\left(\color{blue}{\left(z - -1\right) \cdot z}\right)} \]
      13. distribute-lft-neg-inN/A

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

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

        \[\leadsto \left(-y\right) \cdot \frac{\frac{x}{z}}{\left(\mathsf{neg}\left(\color{blue}{\left(z - -1\right)}\right)\right) \cdot z} \]
      16. sub-negate-revN/A

        \[\leadsto \left(-y\right) \cdot \frac{\frac{x}{z}}{\color{blue}{\left(-1 - z\right)} \cdot z} \]
      17. lower--.f6490.1%

        \[\leadsto \left(-y\right) \cdot \frac{\frac{x}{z}}{\color{blue}{\left(-1 - z\right)} \cdot z} \]
    5. Applied rewrites90.1%

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

Alternative 4: 94.8% accurate, 0.1× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ t_2 := \left(z \cdot z\right) \cdot \left(z + 1\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -20000000000:\\ \;\;\;\;\frac{\frac{t\_0}{z} \cdot t\_1}{z \cdot z}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-49}:\\ \;\;\;\;\frac{\frac{t\_1}{1 \cdot z}}{z} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot t\_1\\ \end{array}\right) \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (fmax (fabs x) (fabs y)))
       (t_1 (fmin (fabs x) (fabs y)))
       (t_2 (* (* z z) (+ z 1.0))))
  (*
   (copysign 1.0 x)
   (*
    (copysign 1.0 y)
    (if (<= t_2 -20000000000.0)
      (/ (* (/ t_0 z) t_1) (* z z))
      (if (<= t_2 5e-49)
        (* (/ (/ t_1 (* 1.0 z)) z) t_0)
        (* (/ t_0 (* (* (- z -1.0) z) z)) t_1)))))))
double code(double x, double y, double z) {
	double t_0 = fmax(fabs(x), fabs(y));
	double t_1 = fmin(fabs(x), fabs(y));
	double t_2 = (z * z) * (z + 1.0);
	double tmp;
	if (t_2 <= -20000000000.0) {
		tmp = ((t_0 / z) * t_1) / (z * z);
	} else if (t_2 <= 5e-49) {
		tmp = ((t_1 / (1.0 * z)) / z) * t_0;
	} else {
		tmp = (t_0 / (((z - -1.0) * z) * z)) * t_1;
	}
	return copysign(1.0, x) * (copysign(1.0, y) * tmp);
}
public static double code(double x, double y, double z) {
	double t_0 = fmax(Math.abs(x), Math.abs(y));
	double t_1 = fmin(Math.abs(x), Math.abs(y));
	double t_2 = (z * z) * (z + 1.0);
	double tmp;
	if (t_2 <= -20000000000.0) {
		tmp = ((t_0 / z) * t_1) / (z * z);
	} else if (t_2 <= 5e-49) {
		tmp = ((t_1 / (1.0 * z)) / z) * t_0;
	} else {
		tmp = (t_0 / (((z - -1.0) * z) * z)) * t_1;
	}
	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * tmp);
}
def code(x, y, z):
	t_0 = fmax(math.fabs(x), math.fabs(y))
	t_1 = fmin(math.fabs(x), math.fabs(y))
	t_2 = (z * z) * (z + 1.0)
	tmp = 0
	if t_2 <= -20000000000.0:
		tmp = ((t_0 / z) * t_1) / (z * z)
	elif t_2 <= 5e-49:
		tmp = ((t_1 / (1.0 * z)) / z) * t_0
	else:
		tmp = (t_0 / (((z - -1.0) * z) * z)) * t_1
	return math.copysign(1.0, x) * (math.copysign(1.0, y) * tmp)
function code(x, y, z)
	t_0 = fmax(abs(x), abs(y))
	t_1 = fmin(abs(x), abs(y))
	t_2 = Float64(Float64(z * z) * Float64(z + 1.0))
	tmp = 0.0
	if (t_2 <= -20000000000.0)
		tmp = Float64(Float64(Float64(t_0 / z) * t_1) / Float64(z * z));
	elseif (t_2 <= 5e-49)
		tmp = Float64(Float64(Float64(t_1 / Float64(1.0 * z)) / z) * t_0);
	else
		tmp = Float64(Float64(t_0 / Float64(Float64(Float64(z - -1.0) * z) * z)) * t_1);
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * tmp))
end
function tmp_2 = code(x, y, z)
	t_0 = max(abs(x), abs(y));
	t_1 = min(abs(x), abs(y));
	t_2 = (z * z) * (z + 1.0);
	tmp = 0.0;
	if (t_2 <= -20000000000.0)
		tmp = ((t_0 / z) * t_1) / (z * z);
	elseif (t_2 <= 5e-49)
		tmp = ((t_1 / (1.0 * z)) / z) * t_0;
	else
		tmp = (t_0 / (((z - -1.0) * z) * z)) * t_1;
	end
	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * tmp);
end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, -20000000000.0], N[(N[(N[(t$95$0 / z), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-49], N[(N[(N[(t$95$1 / N[(1.0 * z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(t$95$0 / N[(N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\
t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
t_2 := \left(z \cdot z\right) \cdot \left(z + 1\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -20000000000:\\
\;\;\;\;\frac{\frac{t\_0}{z} \cdot t\_1}{z \cdot z}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-49}:\\
\;\;\;\;\frac{\frac{t\_1}{1 \cdot z}}{z} \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot t\_1\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < -2e10

    1. Initial program 83.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
      12. associate-/l*N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
      14. lower-/.f6496.2%

        \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
      15. lift-+.f64N/A

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
      16. add-flipN/A

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

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
      18. metadata-eval96.2%

        \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
    3. Applied rewrites96.2%

      \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z - -1}}{z} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{z} \cdot y}}{z - -1}}{z} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z} \cdot \frac{y}{z - -1}}}{z} \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\frac{y}{z - -1}}{z}} \]
      7. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{\frac{y}{z - -1}}{z} \]
      8. frac-timesN/A

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{z - -1}}{z \cdot z}} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{x \cdot \frac{y}{z - -1}}{\color{blue}{z \cdot z}} \]
      10. associate-/l*N/A

        \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{z - -1}}}{z \cdot z} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{x \cdot y}}{z - -1}}{z \cdot z} \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z - -1}}{z \cdot z}} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{x \cdot y}}{z - -1}}{z \cdot z} \]
      14. *-commutativeN/A

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{z - -1}}{z \cdot z} \]
      15. associate-*l/N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{z - -1} \cdot x}}{z \cdot z} \]
      16. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{z - -1} \cdot x}}{z \cdot z} \]
      17. lower-/.f6487.9%

        \[\leadsto \frac{\color{blue}{\frac{y}{z - -1}} \cdot x}{z \cdot z} \]
    5. Applied rewrites87.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{z - -1} \cdot x}{z \cdot z}} \]
    6. Taylor expanded in z around inf

      \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{z}}}{z \cdot z} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{\color{blue}{z}}}{z \cdot z} \]
      2. lower-*.f6457.8%

        \[\leadsto \frac{\frac{x \cdot y}{z}}{z \cdot z} \]
    8. Applied rewrites57.8%

      \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{z}}}{z \cdot z} \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{\color{blue}{z}}}{z \cdot z} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{z}}{z \cdot z} \]
      3. associate-/l*N/A

        \[\leadsto \frac{x \cdot \color{blue}{\frac{y}{z}}}{z \cdot z} \]
      4. lift-/.f64N/A

        \[\leadsto \frac{x \cdot \frac{y}{\color{blue}{z}}}{z \cdot z} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{z} \cdot \color{blue}{x}}{z \cdot z} \]
      6. lower-*.f6460.3%

        \[\leadsto \frac{\frac{y}{z} \cdot \color{blue}{x}}{z \cdot z} \]
    10. Applied rewrites60.3%

      \[\leadsto \frac{\frac{y}{z} \cdot \color{blue}{x}}{z \cdot z} \]

    if -2e10 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < 4.9999999999999999e-49

    1. Initial program 83.2%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\left(z \cdot z\right) \cdot 1}\right) \cdot y} \]
        8. mult-flip-revN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{x}{\color{blue}{\left(1 \cdot z\right)} \cdot z} \cdot y \]
        16. lower-*.f6472.2%

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{x}{1 \cdot z}}{z}} \cdot y \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{x}{1 \cdot z}}{z}} \cdot y \]
        5. lower-/.f6473.6%

          \[\leadsto \frac{\color{blue}{\frac{x}{1 \cdot z}}}{z} \cdot y \]
      5. Applied rewrites73.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{1 \cdot z}}{z}} \cdot y \]

      if 4.9999999999999999e-49 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))

      1. Initial program 83.2%

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
        6. lower-/.f6485.0%

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

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

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

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

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

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

          \[\leadsto \frac{y}{\color{blue}{\left(\left(z + 1\right) \cdot z\right)} \cdot z} \cdot x \]
        13. lower-*.f6485.0%

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

          \[\leadsto \frac{y}{\left(\color{blue}{\left(z + 1\right)} \cdot z\right) \cdot z} \cdot x \]
        15. add-flipN/A

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

          \[\leadsto \frac{y}{\left(\color{blue}{\left(z - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z\right) \cdot z} \cdot x \]
        17. metadata-eval85.0%

          \[\leadsto \frac{y}{\left(\left(z - \color{blue}{-1}\right) \cdot z\right) \cdot z} \cdot x \]
      3. Applied rewrites85.0%

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

    Alternative 5: 94.0% accurate, 0.1× speedup?

    \[\begin{array}{l} t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ t_2 := \frac{t\_0}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot t\_1\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-52}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 10^{-24}:\\ \;\;\;\;\frac{\frac{t\_1}{1 \cdot z}}{z} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array}\right) \end{array} \]
    (FPCore (x y z)
      :precision binary64
      (let* ((t_0 (fmax (fabs x) (fabs y)))
           (t_1 (fmin (fabs x) (fabs y)))
           (t_2 (* (/ t_0 (* (* (- z -1.0) z) z)) t_1)))
      (*
       (copysign 1.0 x)
       (*
        (copysign 1.0 y)
        (if (<= z -5e-52)
          t_2
          (if (<= z 1e-24) (* (/ (/ t_1 (* 1.0 z)) z) t_0) t_2))))))
    double code(double x, double y, double z) {
    	double t_0 = fmax(fabs(x), fabs(y));
    	double t_1 = fmin(fabs(x), fabs(y));
    	double t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1;
    	double tmp;
    	if (z <= -5e-52) {
    		tmp = t_2;
    	} else if (z <= 1e-24) {
    		tmp = ((t_1 / (1.0 * z)) / z) * t_0;
    	} else {
    		tmp = t_2;
    	}
    	return copysign(1.0, x) * (copysign(1.0, y) * tmp);
    }
    
    public static double code(double x, double y, double z) {
    	double t_0 = fmax(Math.abs(x), Math.abs(y));
    	double t_1 = fmin(Math.abs(x), Math.abs(y));
    	double t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1;
    	double tmp;
    	if (z <= -5e-52) {
    		tmp = t_2;
    	} else if (z <= 1e-24) {
    		tmp = ((t_1 / (1.0 * z)) / z) * t_0;
    	} else {
    		tmp = t_2;
    	}
    	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * tmp);
    }
    
    def code(x, y, z):
    	t_0 = fmax(math.fabs(x), math.fabs(y))
    	t_1 = fmin(math.fabs(x), math.fabs(y))
    	t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1
    	tmp = 0
    	if z <= -5e-52:
    		tmp = t_2
    	elif z <= 1e-24:
    		tmp = ((t_1 / (1.0 * z)) / z) * t_0
    	else:
    		tmp = t_2
    	return math.copysign(1.0, x) * (math.copysign(1.0, y) * tmp)
    
    function code(x, y, z)
    	t_0 = fmax(abs(x), abs(y))
    	t_1 = fmin(abs(x), abs(y))
    	t_2 = Float64(Float64(t_0 / Float64(Float64(Float64(z - -1.0) * z) * z)) * t_1)
    	tmp = 0.0
    	if (z <= -5e-52)
    		tmp = t_2;
    	elseif (z <= 1e-24)
    		tmp = Float64(Float64(Float64(t_1 / Float64(1.0 * z)) / z) * t_0);
    	else
    		tmp = t_2;
    	end
    	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * tmp))
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = max(abs(x), abs(y));
    	t_1 = min(abs(x), abs(y));
    	t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1;
    	tmp = 0.0;
    	if (z <= -5e-52)
    		tmp = t_2;
    	elseif (z <= 1e-24)
    		tmp = ((t_1 / (1.0 * z)) / z) * t_0;
    	else
    		tmp = t_2;
    	end
    	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * tmp);
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 / N[(N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[z, -5e-52], t$95$2, If[LessEqual[z, 1e-24], N[(N[(N[(t$95$1 / N[(1.0 * z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * t$95$0), $MachinePrecision], t$95$2]]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\
    t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
    t_2 := \frac{t\_0}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot t\_1\\
    \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -5 \cdot 10^{-52}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;z \leq 10^{-24}:\\
    \;\;\;\;\frac{\frac{t\_1}{1 \cdot z}}{z} \cdot t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}\right)
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -5e-52 or 9.9999999999999992e-25 < z

      1. Initial program 83.2%

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
        6. lower-/.f6485.0%

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

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

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

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

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

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

          \[\leadsto \frac{y}{\color{blue}{\left(\left(z + 1\right) \cdot z\right)} \cdot z} \cdot x \]
        13. lower-*.f6485.0%

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

          \[\leadsto \frac{y}{\left(\color{blue}{\left(z + 1\right)} \cdot z\right) \cdot z} \cdot x \]
        15. add-flipN/A

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

          \[\leadsto \frac{y}{\left(\color{blue}{\left(z - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z\right) \cdot z} \cdot x \]
        17. metadata-eval85.0%

          \[\leadsto \frac{y}{\left(\left(z - \color{blue}{-1}\right) \cdot z\right) \cdot z} \cdot x \]
      3. Applied rewrites85.0%

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

      if -5e-52 < z < 9.9999999999999992e-25

      1. Initial program 83.2%

        \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
      2. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\left(z \cdot z\right) \cdot 1}\right) \cdot y} \]
          8. mult-flip-revN/A

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

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

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

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

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(1 \cdot z\right)} \cdot z} \cdot y \]
          16. lower-*.f6472.2%

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{x}{1 \cdot z}}{z}} \cdot y \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{x}{1 \cdot z}}{z}} \cdot y \]
          5. lower-/.f6473.6%

            \[\leadsto \frac{\color{blue}{\frac{x}{1 \cdot z}}}{z} \cdot y \]
        5. Applied rewrites73.6%

          \[\leadsto \color{blue}{\frac{\frac{x}{1 \cdot z}}{z}} \cdot y \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 6: 93.2% accurate, 0.1× speedup?

      \[\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\frac{\mathsf{max}\left(\left|x\right|, \left|y\right|\right)}{\left(z - -1\right) \cdot z} \cdot \frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{z}\right)\right) \]
      (FPCore (x y z)
        :precision binary64
        (*
       (copysign 1.0 x)
       (*
        (copysign 1.0 y)
        (*
         (/ (fmax (fabs x) (fabs y)) (* (- z -1.0) z))
         (/ (fmin (fabs x) (fabs y)) z)))))
      double code(double x, double y, double z) {
      	return copysign(1.0, x) * (copysign(1.0, y) * ((fmax(fabs(x), fabs(y)) / ((z - -1.0) * z)) * (fmin(fabs(x), fabs(y)) / z)));
      }
      
      public static double code(double x, double y, double z) {
      	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * ((fmax(Math.abs(x), Math.abs(y)) / ((z - -1.0) * z)) * (fmin(Math.abs(x), Math.abs(y)) / z)));
      }
      
      def code(x, y, z):
      	return math.copysign(1.0, x) * (math.copysign(1.0, y) * ((fmax(math.fabs(x), math.fabs(y)) / ((z - -1.0) * z)) * (fmin(math.fabs(x), math.fabs(y)) / z)))
      
      function code(x, y, z)
      	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(Float64(fmax(abs(x), abs(y)) / Float64(Float64(z - -1.0) * z)) * Float64(fmin(abs(x), abs(y)) / z))))
      end
      
      function tmp = code(x, y, z)
      	tmp = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((max(abs(x), abs(y)) / ((z - -1.0) * z)) * (min(abs(x), abs(y)) / z)));
      end
      
      code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[(N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision] / N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\frac{\mathsf{max}\left(\left|x\right|, \left|y\right|\right)}{\left(z - -1\right) \cdot z} \cdot \frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{z}\right)\right)
      
      Derivation
      1. Initial program 83.2%

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
        8. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
        10. lift-*.f64N/A

          \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
        11. *-commutativeN/A

          \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
        12. associate-/l*N/A

          \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
        13. lower-*.f64N/A

          \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
        14. lower-/.f6496.2%

          \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
        15. lift-+.f64N/A

          \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
        16. add-flipN/A

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

          \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
        18. metadata-eval96.2%

          \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
      3. Applied rewrites96.2%

        \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
        3. associate-/l/N/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z}} \cdot \frac{x}{z} \]
        8. lower-*.f6494.1%

          \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z} \cdot \frac{x}{z}} \]
      5. Applied rewrites94.1%

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

      Alternative 7: 92.2% accurate, 0.1× speedup?

      \[\begin{array}{l} t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ t_2 := \frac{t\_0}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot t\_1\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-32}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 10^{-24}:\\ \;\;\;\;\frac{t\_0}{z} \cdot \frac{t\_1}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array}\right) \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (fmax (fabs x) (fabs y)))
             (t_1 (fmin (fabs x) (fabs y)))
             (t_2 (* (/ t_0 (* (* (- z -1.0) z) z)) t_1)))
        (*
         (copysign 1.0 x)
         (*
          (copysign 1.0 y)
          (if (<= z -2e-32)
            t_2
            (if (<= z 1e-24) (* (/ t_0 z) (/ t_1 z)) t_2))))))
      double code(double x, double y, double z) {
      	double t_0 = fmax(fabs(x), fabs(y));
      	double t_1 = fmin(fabs(x), fabs(y));
      	double t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1;
      	double tmp;
      	if (z <= -2e-32) {
      		tmp = t_2;
      	} else if (z <= 1e-24) {
      		tmp = (t_0 / z) * (t_1 / z);
      	} else {
      		tmp = t_2;
      	}
      	return copysign(1.0, x) * (copysign(1.0, y) * tmp);
      }
      
      public static double code(double x, double y, double z) {
      	double t_0 = fmax(Math.abs(x), Math.abs(y));
      	double t_1 = fmin(Math.abs(x), Math.abs(y));
      	double t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1;
      	double tmp;
      	if (z <= -2e-32) {
      		tmp = t_2;
      	} else if (z <= 1e-24) {
      		tmp = (t_0 / z) * (t_1 / z);
      	} else {
      		tmp = t_2;
      	}
      	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * tmp);
      }
      
      def code(x, y, z):
      	t_0 = fmax(math.fabs(x), math.fabs(y))
      	t_1 = fmin(math.fabs(x), math.fabs(y))
      	t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1
      	tmp = 0
      	if z <= -2e-32:
      		tmp = t_2
      	elif z <= 1e-24:
      		tmp = (t_0 / z) * (t_1 / z)
      	else:
      		tmp = t_2
      	return math.copysign(1.0, x) * (math.copysign(1.0, y) * tmp)
      
      function code(x, y, z)
      	t_0 = fmax(abs(x), abs(y))
      	t_1 = fmin(abs(x), abs(y))
      	t_2 = Float64(Float64(t_0 / Float64(Float64(Float64(z - -1.0) * z) * z)) * t_1)
      	tmp = 0.0
      	if (z <= -2e-32)
      		tmp = t_2;
      	elseif (z <= 1e-24)
      		tmp = Float64(Float64(t_0 / z) * Float64(t_1 / z));
      	else
      		tmp = t_2;
      	end
      	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * tmp))
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = max(abs(x), abs(y));
      	t_1 = min(abs(x), abs(y));
      	t_2 = (t_0 / (((z - -1.0) * z) * z)) * t_1;
      	tmp = 0.0;
      	if (z <= -2e-32)
      		tmp = t_2;
      	elseif (z <= 1e-24)
      		tmp = (t_0 / z) * (t_1 / z);
      	else
      		tmp = t_2;
      	end
      	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * tmp);
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 / N[(N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[z, -2e-32], t$95$2, If[LessEqual[z, 1e-24], N[(N[(t$95$0 / z), $MachinePrecision] * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], t$95$2]]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\
      t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
      t_2 := \frac{t\_0}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot t\_1\\
      \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
      \mathbf{if}\;z \leq -2 \cdot 10^{-32}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;z \leq 10^{-24}:\\
      \;\;\;\;\frac{t\_0}{z} \cdot \frac{t\_1}{z}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}\right)
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -2.0000000000000001e-32 or 9.9999999999999992e-25 < z

        1. Initial program 83.2%

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
          6. lower-/.f6485.0%

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

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

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

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

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

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

            \[\leadsto \frac{y}{\color{blue}{\left(\left(z + 1\right) \cdot z\right)} \cdot z} \cdot x \]
          13. lower-*.f6485.0%

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

            \[\leadsto \frac{y}{\left(\color{blue}{\left(z + 1\right)} \cdot z\right) \cdot z} \cdot x \]
          15. add-flipN/A

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

            \[\leadsto \frac{y}{\left(\color{blue}{\left(z - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z\right) \cdot z} \cdot x \]
          17. metadata-eval85.0%

            \[\leadsto \frac{y}{\left(\left(z - \color{blue}{-1}\right) \cdot z\right) \cdot z} \cdot x \]
        3. Applied rewrites85.0%

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

        if -2.0000000000000001e-32 < z < 9.9999999999999992e-25

        1. Initial program 83.2%

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
          9. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
          10. lift-*.f64N/A

            \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
          11. *-commutativeN/A

            \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
          12. associate-/l*N/A

            \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
          13. lower-*.f64N/A

            \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
          14. lower-/.f6496.2%

            \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
          15. lift-+.f64N/A

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
          16. add-flipN/A

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

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
          18. metadata-eval96.2%

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
        3. Applied rewrites96.2%

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
        4. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
          3. associate-/l/N/A

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

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

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

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

            \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z}} \cdot \frac{x}{z} \]
          8. lower-*.f6494.1%

            \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z} \cdot \frac{x}{z}} \]
        5. Applied rewrites94.1%

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

          \[\leadsto \color{blue}{\frac{y}{z}} \cdot \frac{x}{z} \]
        7. Step-by-step derivation
          1. lower-/.f6473.9%

            \[\leadsto \frac{y}{\color{blue}{z}} \cdot \frac{x}{z} \]
        8. Applied rewrites73.9%

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

      Alternative 8: 90.5% accurate, 0.7× speedup?

      \[\begin{array}{l} t_0 := \frac{x}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot y\\ \mathbf{if}\;z \leq -2 \cdot 10^{-32}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-133}:\\ \;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (* (/ x (* (* (- z -1.0) z) z)) y)))
        (if (<= z -2e-32) t_0 (if (<= z 2e-133) (* (/ y z) (/ x z)) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = (x / (((z - -1.0) * z) * z)) * y;
      	double tmp;
      	if (z <= -2e-32) {
      		tmp = t_0;
      	} else if (z <= 2e-133) {
      		tmp = (y / z) * (x / z);
      	} else {
      		tmp = t_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)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: t_0
          real(8) :: tmp
          t_0 = (x / (((z - (-1.0d0)) * z) * z)) * y
          if (z <= (-2d-32)) then
              tmp = t_0
          else if (z <= 2d-133) then
              tmp = (y / z) * (x / z)
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = (x / (((z - -1.0) * z) * z)) * y;
      	double tmp;
      	if (z <= -2e-32) {
      		tmp = t_0;
      	} else if (z <= 2e-133) {
      		tmp = (y / z) * (x / z);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = (x / (((z - -1.0) * z) * z)) * y
      	tmp = 0
      	if z <= -2e-32:
      		tmp = t_0
      	elif z <= 2e-133:
      		tmp = (y / z) * (x / z)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(Float64(x / Float64(Float64(Float64(z - -1.0) * z) * z)) * y)
      	tmp = 0.0
      	if (z <= -2e-32)
      		tmp = t_0;
      	elseif (z <= 2e-133)
      		tmp = Float64(Float64(y / z) * Float64(x / z));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = (x / (((z - -1.0) * z) * z)) * y;
      	tmp = 0.0;
      	if (z <= -2e-32)
      		tmp = t_0;
      	elseif (z <= 2e-133)
      		tmp = (y / z) * (x / z);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x / N[(N[(N[(z - -1.0), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[z, -2e-32], t$95$0, If[LessEqual[z, 2e-133], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      t_0 := \frac{x}{\left(\left(z - -1\right) \cdot z\right) \cdot z} \cdot y\\
      \mathbf{if}\;z \leq -2 \cdot 10^{-32}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq 2 \cdot 10^{-133}:\\
      \;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -2.0000000000000001e-32 or 2.0000000000000001e-133 < z

        1. Initial program 83.2%

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\right) \cdot y} \]
          8. mult-flip-revN/A

            \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
          9. lower-/.f6484.4%

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

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

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

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(\left(z + 1\right) \cdot z\right)} \cdot z} \cdot y \]
          16. lower-*.f6484.4%

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

            \[\leadsto \frac{x}{\left(\color{blue}{\left(z + 1\right)} \cdot z\right) \cdot z} \cdot y \]
          18. add-flipN/A

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

            \[\leadsto \frac{x}{\left(\color{blue}{\left(z - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z\right) \cdot z} \cdot y \]
          20. metadata-eval84.4%

            \[\leadsto \frac{x}{\left(\left(z - \color{blue}{-1}\right) \cdot z\right) \cdot z} \cdot y \]
        3. Applied rewrites84.4%

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

        if -2.0000000000000001e-32 < z < 2.0000000000000001e-133

        1. Initial program 83.2%

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
          9. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
          10. lift-*.f64N/A

            \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
          11. *-commutativeN/A

            \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
          12. associate-/l*N/A

            \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
          13. lower-*.f64N/A

            \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
          14. lower-/.f6496.2%

            \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
          15. lift-+.f64N/A

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
          16. add-flipN/A

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

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
          18. metadata-eval96.2%

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
        3. Applied rewrites96.2%

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
        4. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
          3. associate-/l/N/A

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

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

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

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

            \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z}} \cdot \frac{x}{z} \]
          8. lower-*.f6494.1%

            \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z} \cdot \frac{x}{z}} \]
        5. Applied rewrites94.1%

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

          \[\leadsto \color{blue}{\frac{y}{z}} \cdot \frac{x}{z} \]
        7. Step-by-step derivation
          1. lower-/.f6473.9%

            \[\leadsto \frac{y}{\color{blue}{z}} \cdot \frac{x}{z} \]
        8. Applied rewrites73.9%

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

      Alternative 9: 80.2% accurate, 0.0× speedup?

      \[\begin{array}{l} t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \cdot t\_0 \leq 5 \cdot 10^{-94}:\\ \;\;\;\;\frac{t\_0}{z} \cdot \frac{t\_1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1}{\left(1 \cdot z\right) \cdot z} \cdot t\_0\\ \end{array}\right) \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (fmax (fabs x) (fabs y))) (t_1 (fmin (fabs x) (fabs y))))
        (*
         (copysign 1.0 x)
         (*
          (copysign 1.0 y)
          (if (<= (* t_1 t_0) 5e-94)
            (* (/ t_0 z) (/ t_1 z))
            (* (/ t_1 (* (* 1.0 z) z)) t_0))))))
      double code(double x, double y, double z) {
      	double t_0 = fmax(fabs(x), fabs(y));
      	double t_1 = fmin(fabs(x), fabs(y));
      	double tmp;
      	if ((t_1 * t_0) <= 5e-94) {
      		tmp = (t_0 / z) * (t_1 / z);
      	} else {
      		tmp = (t_1 / ((1.0 * z) * z)) * t_0;
      	}
      	return copysign(1.0, x) * (copysign(1.0, y) * tmp);
      }
      
      public static double code(double x, double y, double z) {
      	double t_0 = fmax(Math.abs(x), Math.abs(y));
      	double t_1 = fmin(Math.abs(x), Math.abs(y));
      	double tmp;
      	if ((t_1 * t_0) <= 5e-94) {
      		tmp = (t_0 / z) * (t_1 / z);
      	} else {
      		tmp = (t_1 / ((1.0 * z) * z)) * t_0;
      	}
      	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * tmp);
      }
      
      def code(x, y, z):
      	t_0 = fmax(math.fabs(x), math.fabs(y))
      	t_1 = fmin(math.fabs(x), math.fabs(y))
      	tmp = 0
      	if (t_1 * t_0) <= 5e-94:
      		tmp = (t_0 / z) * (t_1 / z)
      	else:
      		tmp = (t_1 / ((1.0 * z) * z)) * t_0
      	return math.copysign(1.0, x) * (math.copysign(1.0, y) * tmp)
      
      function code(x, y, z)
      	t_0 = fmax(abs(x), abs(y))
      	t_1 = fmin(abs(x), abs(y))
      	tmp = 0.0
      	if (Float64(t_1 * t_0) <= 5e-94)
      		tmp = Float64(Float64(t_0 / z) * Float64(t_1 / z));
      	else
      		tmp = Float64(Float64(t_1 / Float64(Float64(1.0 * z) * z)) * t_0);
      	end
      	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * tmp))
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = max(abs(x), abs(y));
      	t_1 = min(abs(x), abs(y));
      	tmp = 0.0;
      	if ((t_1 * t_0) <= 5e-94)
      		tmp = (t_0 / z) * (t_1 / z);
      	else
      		tmp = (t_1 / ((1.0 * z) * z)) * t_0;
      	end
      	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * tmp);
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(t$95$1 * t$95$0), $MachinePrecision], 5e-94], N[(N[(t$95$0 / z), $MachinePrecision] * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / N[(N[(1.0 * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      t_0 := \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\\
      t_1 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
      \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
      \mathbf{if}\;t\_1 \cdot t\_0 \leq 5 \cdot 10^{-94}:\\
      \;\;\;\;\frac{t\_0}{z} \cdot \frac{t\_1}{z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{t\_1}{\left(1 \cdot z\right) \cdot z} \cdot t\_0\\
      
      
      \end{array}\right)
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 x y) < 4.9999999999999995e-94

        1. Initial program 83.2%

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z}}{z + 1}}{z}} \]
          9. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z}}{z + 1}}}{z} \]
          10. lift-*.f64N/A

            \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z}}{z + 1}}{z} \]
          11. *-commutativeN/A

            \[\leadsto \frac{\frac{\frac{\color{blue}{y \cdot x}}{z}}{z + 1}}{z} \]
          12. associate-/l*N/A

            \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
          13. lower-*.f64N/A

            \[\leadsto \frac{\frac{\color{blue}{y \cdot \frac{x}{z}}}{z + 1}}{z} \]
          14. lower-/.f6496.2%

            \[\leadsto \frac{\frac{y \cdot \color{blue}{\frac{x}{z}}}{z + 1}}{z} \]
          15. lift-+.f64N/A

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z + 1}}}{z} \]
          16. add-flipN/A

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

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{\color{blue}{z - \left(\mathsf{neg}\left(1\right)\right)}}}{z} \]
          18. metadata-eval96.2%

            \[\leadsto \frac{\frac{y \cdot \frac{x}{z}}{z - \color{blue}{-1}}}{z} \]
        3. Applied rewrites96.2%

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
        4. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{z}}{z - -1}}{z}} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{y \cdot \frac{x}{z}}{z - -1}}}{z} \]
          3. associate-/l/N/A

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

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

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

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

            \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z}} \cdot \frac{x}{z} \]
          8. lower-*.f6494.1%

            \[\leadsto \color{blue}{\frac{y}{\left(z - -1\right) \cdot z} \cdot \frac{x}{z}} \]
        5. Applied rewrites94.1%

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

          \[\leadsto \color{blue}{\frac{y}{z}} \cdot \frac{x}{z} \]
        7. Step-by-step derivation
          1. lower-/.f6473.9%

            \[\leadsto \frac{y}{\color{blue}{z}} \cdot \frac{x}{z} \]
        8. Applied rewrites73.9%

          \[\leadsto \color{blue}{\frac{y}{z}} \cdot \frac{x}{z} \]

        if 4.9999999999999995e-94 < (*.f64 x y)

        1. Initial program 83.2%

          \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
        2. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\left(z \cdot z\right) \cdot 1}\right) \cdot y} \]
            8. mult-flip-revN/A

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

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

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

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

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

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

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

              \[\leadsto \frac{x}{\color{blue}{\left(1 \cdot z\right)} \cdot z} \cdot y \]
            16. lower-*.f6472.2%

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

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

        Alternative 10: 75.2% accurate, 0.1× speedup?

        \[\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{\left(1 \cdot z\right) \cdot z} \cdot \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\right)\right) \]
        (FPCore (x y z)
          :precision binary64
          (*
         (copysign 1.0 x)
         (*
          (copysign 1.0 y)
          (*
           (/ (fmin (fabs x) (fabs y)) (* (* 1.0 z) z))
           (fmax (fabs x) (fabs y))))))
        double code(double x, double y, double z) {
        	return copysign(1.0, x) * (copysign(1.0, y) * ((fmin(fabs(x), fabs(y)) / ((1.0 * z) * z)) * fmax(fabs(x), fabs(y))));
        }
        
        public static double code(double x, double y, double z) {
        	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * ((fmin(Math.abs(x), Math.abs(y)) / ((1.0 * z) * z)) * fmax(Math.abs(x), Math.abs(y))));
        }
        
        def code(x, y, z):
        	return math.copysign(1.0, x) * (math.copysign(1.0, y) * ((fmin(math.fabs(x), math.fabs(y)) / ((1.0 * z) * z)) * fmax(math.fabs(x), math.fabs(y))))
        
        function code(x, y, z)
        	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(Float64(fmin(abs(x), abs(y)) / Float64(Float64(1.0 * z) * z)) * fmax(abs(x), abs(y)))))
        end
        
        function tmp = code(x, y, z)
        	tmp = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((min(abs(x), abs(y)) / ((1.0 * z) * z)) * max(abs(x), abs(y))));
        end
        
        code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[(N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision] / N[(N[(1.0 * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{\left(1 \cdot z\right) \cdot z} \cdot \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\right)\right)
        
        Derivation
        1. Initial program 83.2%

          \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
        2. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\left(z \cdot z\right) \cdot 1}\right) \cdot y} \]
            8. mult-flip-revN/A

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

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

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

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

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

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

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

              \[\leadsto \frac{x}{\color{blue}{\left(1 \cdot z\right)} \cdot z} \cdot y \]
            16. lower-*.f6472.2%

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

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

          Reproduce

          ?
          herbie shell --seed 2025258 
          (FPCore (x y z)
            :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
            :precision binary64
            (/ (* x y) (* (* z z) (+ z 1.0))))