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

Percentage Accurate: 82.9% → 97.1%
Time: 2.8s
Alternatives: 7
Speedup: 0.4×

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 7 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: 82.9% 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.1% accurate, 0.4× speedup?

\[\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\frac{\frac{\mathsf{max}\left(\left|x\right|, \left|y\right|\right)}{z - -1}}{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(Float64(fmax(abs(x), abs(y)) / 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[(N[Max[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision] / N[(z - -1.0), $MachinePrecision]), $MachinePrecision] / z), $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{\frac{\mathsf{max}\left(\left|x\right|, \left|y\right|\right)}{z - -1}}{z} \cdot \frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{z}\right)\right)
Derivation
  1. Initial program 82.9%

    \[\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(z, z, z\right)}} \cdot \frac{x}{z} \]
    14. lower-/.f6494.2%

      \[\leadsto \frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot \color{blue}{\frac{x}{z}} \]
  3. Applied rewrites94.2%

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

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

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

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

      \[\leadsto \frac{y \cdot 1}{\color{blue}{z \cdot z + z}} \cdot \frac{x}{z} \]
    5. distribute-lft1-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.9% accurate, 0.3× 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 -50000000000000:\\ \;\;\;\;\frac{\frac{\frac{t\_0}{z} \cdot t\_1}{z}}{z}\\ \mathbf{elif}\;t\_2 \leq 10^{-62}:\\ \;\;\;\;\frac{\frac{t\_1}{1 \cdot z}}{z} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0}{\mathsf{fma}\left(z, z, 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 -50000000000000.0)
      (/ (/ (* (/ t_0 z) t_1) z) z)
      (if (<= t_2 1e-62)
        (* (/ (/ t_1 (* 1.0 z)) z) t_0)
        (* (/ t_0 (* (fma z z 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 <= -50000000000000.0) {
		tmp = (((t_0 / z) * t_1) / z) / z;
	} else if (t_2 <= 1e-62) {
		tmp = ((t_1 / (1.0 * z)) / z) * t_0;
	} else {
		tmp = (t_0 / (fma(z, z, z) * z)) * t_1;
	}
	return copysign(1.0, x) * (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 <= -50000000000000.0)
		tmp = Float64(Float64(Float64(Float64(t_0 / z) * t_1) / z) / z);
	elseif (t_2 <= 1e-62)
		tmp = Float64(Float64(Float64(t_1 / Float64(1.0 * z)) / z) * t_0);
	else
		tmp = Float64(Float64(t_0 / Float64(fma(z, z, z) * z)) * t_1);
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * 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, -50000000000000.0], N[(N[(N[(N[(t$95$0 / z), $MachinePrecision] * t$95$1), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, 1e-62], 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[(z * z + 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 -50000000000000:\\
\;\;\;\;\frac{\frac{\frac{t\_0}{z} \cdot t\_1}{z}}{z}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(z, z, 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))) < -5e13

    1. Initial program 82.9%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e13 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < 1e-62

    1. Initial program 82.9%

      \[\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.4%

        \[\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.4%

          \[\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.4%

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

        \[\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.9%

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

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

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

      1. Initial program 82.9%

        \[\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-/.f6483.7%

          \[\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. lift-+.f64N/A

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

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

          \[\leadsto \frac{y}{\left(z \cdot z + \color{blue}{z}\right) \cdot z} \cdot x \]
        15. lower-fma.f6483.7%

          \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(z, z, z\right)} \cdot z} \cdot x \]
      3. Applied rewrites83.7%

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

    Alternative 3: 94.9% accurate, 0.3× 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{\frac{\frac{t\_0}{z} \cdot t\_1}{z}}{z}\\ t_3 := \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\_3 \leq -50000000000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 0.002:\\ \;\;\;\;\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) t_1) z) z))
           (t_3 (* (* z z) (+ z 1.0))))
      (*
       (copysign 1.0 x)
       (*
        (copysign 1.0 y)
        (if (<= t_3 -50000000000000.0)
          t_2
          (if (<= t_3 0.002) (* (/ (/ 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) * t_1) / z) / z;
    	double t_3 = (z * z) * (z + 1.0);
    	double tmp;
    	if (t_3 <= -50000000000000.0) {
    		tmp = t_2;
    	} else if (t_3 <= 0.002) {
    		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) * t_1) / z) / z;
    	double t_3 = (z * z) * (z + 1.0);
    	double tmp;
    	if (t_3 <= -50000000000000.0) {
    		tmp = t_2;
    	} else if (t_3 <= 0.002) {
    		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) * t_1) / z) / z
    	t_3 = (z * z) * (z + 1.0)
    	tmp = 0
    	if t_3 <= -50000000000000.0:
    		tmp = t_2
    	elif t_3 <= 0.002:
    		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(Float64(Float64(t_0 / z) * t_1) / z) / z)
    	t_3 = Float64(Float64(z * z) * Float64(z + 1.0))
    	tmp = 0.0
    	if (t_3 <= -50000000000000.0)
    		tmp = t_2;
    	elseif (t_3 <= 0.002)
    		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) * t_1) / z) / z;
    	t_3 = (z * z) * (z + 1.0);
    	tmp = 0.0;
    	if (t_3 <= -50000000000000.0)
    		tmp = t_2;
    	elseif (t_3 <= 0.002)
    		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[(N[(N[(t$95$0 / z), $MachinePrecision] * t$95$1), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$3 = 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$3, -50000000000000.0], t$95$2, If[LessEqual[t$95$3, 0.002], 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{\frac{\frac{t\_0}{z} \cdot t\_1}{z}}{z}\\
    t_3 := \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\_3 \leq -50000000000000:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_3 \leq 0.002:\\
    \;\;\;\;\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 (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < -5e13 or 2e-3 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))

      1. Initial program 82.9%

        \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5e13 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < 2e-3

      1. Initial program 82.9%

        \[\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.4%

          \[\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.4%

            \[\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.4%

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

          \[\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.9%

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

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

      Alternative 4: 94.5% accurate, 0.4× 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)}{\mathsf{fma}\left(z, z, z\right)} \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)) (fma z z 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)) / fma(z, z, z)) * (fmin(fabs(x), 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)) / fma(z, z, z)) * Float64(fmin(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[(z * z + 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)}{\mathsf{fma}\left(z, z, z\right)} \cdot \frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{z}\right)\right)
      
      Derivation
      1. Initial program 82.9%

        \[\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(z, z, z\right)}} \cdot \frac{x}{z} \]
        14. lower-/.f6494.2%

          \[\leadsto \frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot \color{blue}{\frac{x}{z}} \]
      3. Applied rewrites94.2%

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

      Alternative 5: 80.8% accurate, 0.4× speedup?

      \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\ t_1 := \mathsf{max}\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 \leq 9.5 \cdot 10^{+30}:\\ \;\;\;\;\frac{t\_1}{1 \cdot z} \cdot \frac{t\_0}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0}{\left(1 \cdot z\right) \cdot z} \cdot t\_1\\ \end{array}\right) \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (fmin (fabs x) (fabs y))) (t_1 (fmax (fabs x) (fabs y))))
        (*
         (copysign 1.0 x)
         (*
          (copysign 1.0 y)
          (if (<= t_1 9.5e+30)
            (* (/ t_1 (* 1.0 z)) (/ t_0 z))
            (* (/ t_0 (* (* 1.0 z) z)) t_1))))))
      double code(double x, double y, double z) {
      	double t_0 = fmin(fabs(x), fabs(y));
      	double t_1 = fmax(fabs(x), fabs(y));
      	double tmp;
      	if (t_1 <= 9.5e+30) {
      		tmp = (t_1 / (1.0 * z)) * (t_0 / z);
      	} else {
      		tmp = (t_0 / ((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 = fmin(Math.abs(x), Math.abs(y));
      	double t_1 = fmax(Math.abs(x), Math.abs(y));
      	double tmp;
      	if (t_1 <= 9.5e+30) {
      		tmp = (t_1 / (1.0 * z)) * (t_0 / z);
      	} else {
      		tmp = (t_0 / ((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 = fmin(math.fabs(x), math.fabs(y))
      	t_1 = fmax(math.fabs(x), math.fabs(y))
      	tmp = 0
      	if t_1 <= 9.5e+30:
      		tmp = (t_1 / (1.0 * z)) * (t_0 / z)
      	else:
      		tmp = (t_0 / ((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 = fmin(abs(x), abs(y))
      	t_1 = fmax(abs(x), abs(y))
      	tmp = 0.0
      	if (t_1 <= 9.5e+30)
      		tmp = Float64(Float64(t_1 / Float64(1.0 * z)) * Float64(t_0 / z));
      	else
      		tmp = Float64(Float64(t_0 / Float64(Float64(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 = min(abs(x), abs(y));
      	t_1 = max(abs(x), abs(y));
      	tmp = 0.0;
      	if (t_1 <= 9.5e+30)
      		tmp = (t_1 / (1.0 * z)) * (t_0 / z);
      	else
      		tmp = (t_0 / ((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[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[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[t$95$1, 9.5e+30], N[(N[(t$95$1 / N[(1.0 * z), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(N[(1.0 * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      t_0 := \mathsf{min}\left(\left|x\right|, \left|y\right|\right)\\
      t_1 := \mathsf{max}\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 \leq 9.5 \cdot 10^{+30}:\\
      \;\;\;\;\frac{t\_1}{1 \cdot z} \cdot \frac{t\_0}{z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{t\_0}{\left(1 \cdot z\right) \cdot z} \cdot t\_1\\
      
      
      \end{array}\right)
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 9.5000000000000003e30

        1. Initial program 82.9%

          \[\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.4%

            \[\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{y}{\color{blue}{1 \cdot z}} \cdot \frac{x}{z} \]
            12. lower-*.f6474.5%

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

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

          if 9.5000000000000003e30 < y

          1. Initial program 82.9%

            \[\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.4%

              \[\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.4%

                \[\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.4%

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

              \[\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 6: 80.8% accurate, 0.5× speedup?

          \[\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\frac{\frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{1 \cdot z}}{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(Float64(fmin(abs(x), abs(y)) / 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[(N[Min[N[Abs[x], $MachinePrecision], N[Abs[y], $MachinePrecision]], $MachinePrecision] / N[(1.0 * z), $MachinePrecision]), $MachinePrecision] / z), $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{\frac{\mathsf{min}\left(\left|x\right|, \left|y\right|\right)}{1 \cdot z}}{z} \cdot \mathsf{max}\left(\left|x\right|, \left|y\right|\right)\right)\right)
          
          Derivation
          1. Initial program 82.9%

            \[\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.4%

              \[\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.4%

                \[\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.4%

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

              \[\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.9%

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

              \[\leadsto \color{blue}{\frac{\frac{x}{1 \cdot z}}{z}} \cdot y \]
            6. Add Preprocessing

            Alternative 7: 75.5% accurate, 0.5× 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 82.9%

              \[\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.4%

                \[\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.4%

                  \[\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.4%

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

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

              Reproduce

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