Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2

Percentage Accurate: 91.0% → 97.7%
Time: 3.4s
Alternatives: 12
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ \frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
double code(double x, double y, double z) {
	return (1.0 / x) / (y * (1.0 + (z * z)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
end function
public static double code(double x, double y, double z) {
	return (1.0 / x) / (y * (1.0 + (z * z)));
}
def code(x, y, z):
	return (1.0 / x) / (y * (1.0 + (z * z)))
function code(x, y, z)
	return Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z))))
end
function tmp = code(x, y, z)
	tmp = (1.0 / x) / (y * (1.0 + (z * z)));
end
code[x_, y_, z_] := N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 91.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
double code(double x, double y, double z) {
	return (1.0 / x) / (y * (1.0 + (z * z)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
end function
public static double code(double x, double y, double z) {
	return (1.0 / x) / (y * (1.0 + (z * z)));
}
def code(x, y, z):
	return (1.0 / x) / (y * (1.0 + (z * z)))
function code(x, y, z)
	return Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z))))
end
function tmp = code(x, y, z)
	tmp = (1.0 / x) / (y * (1.0 + (z * z)));
end
code[x_, y_, z_] := N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\end{array}

Alternative 1: 97.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{1}{\mathsf{fma}\left(y \cdot z, z \cdot x, x \cdot y\right)} \end{array} \]
(FPCore (x y z) :precision binary64 (/ 1.0 (fma (* y z) (* z x) (* x y))))
double code(double x, double y, double z) {
	return 1.0 / fma((y * z), (z * x), (x * y));
}
function code(x, y, z)
	return Float64(1.0 / fma(Float64(y * z), Float64(z * x), Float64(x * y)))
end
code[x_, y_, z_] := N[(1.0 / N[(N[(y * z), $MachinePrecision] * N[(z * x), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\mathsf{fma}\left(y \cdot z, z \cdot x, x \cdot y\right)}
\end{array}
Derivation
  1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{fma}\left(y \cdot z, \color{blue}{z \cdot x}, x \cdot y\right)} \]
    19. lower-*.f6497.7

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

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

Alternative 2: 92.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 1.08 \cdot 10^{+142}:\\ \;\;\;\;\frac{\frac{\frac{1}{x}}{\mathsf{fma}\left(z, z, 1\right)}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z 1.08e+142)
   (/ (/ (/ 1.0 x) (fma z z 1.0)) y)
   (/ 1.0 (* (* (* x y) z) z))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= 1.08e+142) {
		tmp = ((1.0 / x) / fma(z, z, 1.0)) / y;
	} else {
		tmp = 1.0 / (((x * y) * z) * z);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= 1.08e+142)
		tmp = Float64(Float64(Float64(1.0 / x) / fma(z, z, 1.0)) / y);
	else
		tmp = Float64(1.0 / Float64(Float64(Float64(x * y) * z) * z));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, 1.08e+142], N[(N[(N[(1.0 / x), $MachinePrecision] / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.08 \cdot 10^{+142}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{\mathsf{fma}\left(z, z, 1\right)}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.08e142

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{1 + \color{blue}{{z}^{2}}}}{y} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{{z}^{2} + 1}}}{y} \]
      13. pow2N/A

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{z \cdot z} + 1}}{y} \]
      14. lower-fma.f6493.3

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{fma}\left(z, z, 1\right)}}{y}} \]

    if 1.08e142 < z

    1. Initial program 74.1%

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

      \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
      10. pow273.3

        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
      11. +-commutative73.3

        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
      12. pow273.3

        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
    6. Applied rewrites73.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
      7. distribute-lft-outN/A

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

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

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

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

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

        \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
      13. lift-*.f6488.2

        \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
    9. Applied rewrites88.2%

      \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
    10. Taylor expanded in z around inf

      \[\leadsto \frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z} \]
    11. Step-by-step derivation
      1. Applied rewrites88.2%

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

    Alternative 3: 92.2% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \leq 0:\\ \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}{x}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))) 0.0)
       (/ 1.0 (* (* (* x y) z) z))
       (/ (/ 1.0 (* (fma z z 1.0) y)) x)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (((1.0 / x) / (y * (1.0 + (z * z)))) <= 0.0) {
    		tmp = 1.0 / (((x * y) * z) * z);
    	} else {
    		tmp = (1.0 / (fma(z, z, 1.0) * y)) / x;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	tmp = 0.0
    	if (Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))) <= 0.0)
    		tmp = Float64(1.0 / Float64(Float64(Float64(x * y) * z) * z));
    	else
    		tmp = Float64(Float64(1.0 / Float64(fma(z, z, 1.0) * y)) / x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := If[LessEqual[N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(z * z + 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \leq 0:\\
    \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (/.f64 #s(literal 1 binary64) x) (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))) < 0.0

      1. Initial program 87.4%

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

        \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
      3. Step-by-step derivation
        1. pow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
        9. lift-*.f6458.0

          \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
        10. pow258.0

          \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
        11. +-commutative58.0

          \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
        12. pow258.0

          \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
      6. Applied rewrites58.0%

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
        7. distribute-lft-outN/A

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

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

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

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

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

          \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
        13. lift-*.f6475.0

          \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
      9. Applied rewrites75.0%

        \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
      10. Taylor expanded in z around inf

        \[\leadsto \frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z} \]
      11. Step-by-step derivation
        1. Applied rewrites68.2%

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

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

        1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{1}{\left(\color{blue}{z \cdot z} + 1\right) \cdot y}}{x} \]
          16. lower-fma.f6499.6

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

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

      Alternative 4: 77.5% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \leq 0:\\ \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))) 0.0)
         (/ 1.0 (* (* (* x y) z) z))
         (/ (/ 1.0 x) (fma (* y z) z y))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (((1.0 / x) / (y * (1.0 + (z * z)))) <= 0.0) {
      		tmp = 1.0 / (((x * y) * z) * z);
      	} else {
      		tmp = (1.0 / x) / fma((y * z), z, y);
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))) <= 0.0)
      		tmp = Float64(1.0 / Float64(Float64(Float64(x * y) * z) * z));
      	else
      		tmp = Float64(Float64(1.0 / x) / fma(Float64(y * z), z, y));
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \leq 0:\\
      \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (/.f64 #s(literal 1 binary64) x) (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))) < 0.0

        1. Initial program 87.4%

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

          \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
        3. Step-by-step derivation
          1. pow2N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
          9. lift-*.f6458.0

            \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
          10. pow258.0

            \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
          11. +-commutative58.0

            \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
          12. pow258.0

            \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
        6. Applied rewrites58.0%

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
          7. distribute-lft-outN/A

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

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

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

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

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

            \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
          13. lift-*.f6475.0

            \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
        9. Applied rewrites75.0%

          \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
        10. Taylor expanded in z around inf

          \[\leadsto \frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z} \]
        11. Step-by-step derivation
          1. Applied rewrites68.2%

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

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

          1. Initial program 99.5%

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y \cdot {z}^{2} + y}} \]
            8. pow2N/A

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

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

              \[\leadsto \frac{\frac{1}{x}}{\color{blue}{\mathsf{fma}\left(y \cdot z, z, y\right)}} \]
            11. lower-*.f6499.5

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

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

        Alternative 5: 77.4% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \leq 10^{-317}:\\ \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot y\right) \cdot x}\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))) 1e-317)
           (/ 1.0 (* (* (* x y) z) z))
           (/ 1.0 (* (* (fma z z 1.0) y) x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (((1.0 / x) / (y * (1.0 + (z * z)))) <= 1e-317) {
        		tmp = 1.0 / (((x * y) * z) * z);
        	} else {
        		tmp = 1.0 / ((fma(z, z, 1.0) * y) * x);
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))) <= 1e-317)
        		tmp = Float64(1.0 / Float64(Float64(Float64(x * y) * z) * z));
        	else
        		tmp = Float64(1.0 / Float64(Float64(fma(z, z, 1.0) * y) * x));
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-317], N[(1.0 / N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(z * z + 1.0), $MachinePrecision] * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \leq 10^{-317}:\\
        \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot y\right) \cdot x}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (/.f64 #s(literal 1 binary64) x) (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))) < 1.00000023e-317

          1. Initial program 87.4%

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

            \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
          3. Step-by-step derivation
            1. pow2N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
            9. lift-*.f6458.0

              \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
            10. pow258.0

              \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
            11. +-commutative58.0

              \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
            12. pow258.0

              \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
          6. Applied rewrites58.0%

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
            7. distribute-lft-outN/A

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

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

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

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

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

              \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
            13. lift-*.f6475.0

              \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
          9. Applied rewrites75.0%

            \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
          10. Taylor expanded in z around inf

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

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

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

            1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 6: 77.3% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{elif}\;z \leq 1.92 \cdot 10^{+143}:\\ \;\;\;\;\frac{\frac{1}{\left(z \cdot z\right) \cdot x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= z 1.0)
             (/ (/ 1.0 x) y)
             (if (<= z 1.92e+143)
               (/ (/ 1.0 (* (* z z) x)) y)
               (/ 1.0 (* (* (* x y) z) z)))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (z <= 1.0) {
          		tmp = (1.0 / x) / y;
          	} else if (z <= 1.92e+143) {
          		tmp = (1.0 / ((z * z) * x)) / y;
          	} else {
          		tmp = 1.0 / (((x * y) * z) * z);
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8) :: tmp
              if (z <= 1.0d0) then
                  tmp = (1.0d0 / x) / y
              else if (z <= 1.92d+143) then
                  tmp = (1.0d0 / ((z * z) * x)) / y
              else
                  tmp = 1.0d0 / (((x * y) * z) * z)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (z <= 1.0) {
          		tmp = (1.0 / x) / y;
          	} else if (z <= 1.92e+143) {
          		tmp = (1.0 / ((z * z) * x)) / y;
          	} else {
          		tmp = 1.0 / (((x * y) * z) * z);
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if z <= 1.0:
          		tmp = (1.0 / x) / y
          	elif z <= 1.92e+143:
          		tmp = (1.0 / ((z * z) * x)) / y
          	else:
          		tmp = 1.0 / (((x * y) * z) * z)
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (z <= 1.0)
          		tmp = Float64(Float64(1.0 / x) / y);
          	elseif (z <= 1.92e+143)
          		tmp = Float64(Float64(1.0 / Float64(Float64(z * z) * x)) / y);
          	else
          		tmp = Float64(1.0 / Float64(Float64(Float64(x * y) * z) * z));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (z <= 1.0)
          		tmp = (1.0 / x) / y;
          	elseif (z <= 1.92e+143)
          		tmp = (1.0 / ((z * z) * x)) / y;
          	else
          		tmp = 1.0 / (((x * y) * z) * z);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.92e+143], N[(N[(1.0 / N[(N[(z * z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq 1:\\
          \;\;\;\;\frac{\frac{1}{x}}{y}\\
          
          \mathbf{elif}\;z \leq 1.92 \cdot 10^{+143}:\\
          \;\;\;\;\frac{\frac{1}{\left(z \cdot z\right) \cdot x}}{y}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < 1

            1. Initial program 93.8%

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

              \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y}} \]
            3. Step-by-step derivation
              1. Applied rewrites71.3%

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

              if 1 < z < 1.9199999999999999e143

              1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\frac{\frac{1}{x}}{1 + \color{blue}{{z}^{2}}}}{y} \]
                12. +-commutativeN/A

                  \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{{z}^{2} + 1}}}{y} \]
                13. pow2N/A

                  \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{z \cdot z} + 1}}{y} \]
                14. lower-fma.f6491.7

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

                \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{fma}\left(z, z, 1\right)}}{y}} \]
              4. Taylor expanded in z around inf

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

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

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

                  \[\leadsto \frac{\frac{1}{{z}^{2} \cdot \color{blue}{x}}}{y} \]
                4. pow2N/A

                  \[\leadsto \frac{\frac{1}{\left(z \cdot z\right) \cdot x}}{y} \]
                5. lift-*.f6489.4

                  \[\leadsto \frac{\frac{1}{\left(z \cdot z\right) \cdot x}}{y} \]
              6. Applied rewrites89.4%

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

              if 1.9199999999999999e143 < z

              1. Initial program 74.0%

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

                \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
              3. Step-by-step derivation
                1. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
                10. pow273.3

                  \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                11. +-commutative73.3

                  \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
                12. pow273.3

                  \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
              6. Applied rewrites73.3%

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

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

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

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

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

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

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

                  \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
                7. distribute-lft-outN/A

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

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

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

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

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

                  \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
                13. lift-*.f6488.3

                  \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
              9. Applied rewrites88.3%

                \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
              10. Taylor expanded in z around inf

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

                  \[\leadsto \frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z} \]
              12. Recombined 3 regimes into one program.
              13. Add Preprocessing

              Alternative 7: 75.9% accurate, 0.9× speedup?

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

                1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{1}{\color{blue}{\left(\left(z \cdot z + 1\right) \cdot x\right)} \cdot y} \]
                  9. lift-fma.f6492.8

                    \[\leadsto \frac{1}{\left(\color{blue}{\mathsf{fma}\left(z, z, 1\right)} \cdot x\right) \cdot y} \]
                5. Applied rewrites92.8%

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

                if 1.00000000000000002e141 < z

                1. Initial program 74.3%

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

                  \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
                3. Step-by-step derivation
                  1. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
                  10. pow273.5

                    \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                  11. +-commutative73.5

                    \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
                  12. pow273.5

                    \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                6. Applied rewrites73.5%

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

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

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

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

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

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

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

                    \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
                  7. distribute-lft-outN/A

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

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

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

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

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

                    \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
                  13. lift-*.f6488.3

                    \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
                9. Applied rewrites88.3%

                  \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
                10. Taylor expanded in z around inf

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

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

                Alternative 8: 75.6% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{elif}\;z \leq 10^{+141}:\\ \;\;\;\;\frac{1}{\left(\left(z \cdot z\right) \cdot x\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= z 1.0)
                   (/ (/ 1.0 x) y)
                   (if (<= z 1e+141) (/ 1.0 (* (* (* z z) x) y)) (/ 1.0 (* (* (* x y) z) z)))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (z <= 1.0) {
                		tmp = (1.0 / x) / y;
                	} else if (z <= 1e+141) {
                		tmp = 1.0 / (((z * z) * x) * y);
                	} else {
                		tmp = 1.0 / (((x * y) * z) * z);
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: tmp
                    if (z <= 1.0d0) then
                        tmp = (1.0d0 / x) / y
                    else if (z <= 1d+141) then
                        tmp = 1.0d0 / (((z * z) * x) * y)
                    else
                        tmp = 1.0d0 / (((x * y) * z) * z)
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double tmp;
                	if (z <= 1.0) {
                		tmp = (1.0 / x) / y;
                	} else if (z <= 1e+141) {
                		tmp = 1.0 / (((z * z) * x) * y);
                	} else {
                		tmp = 1.0 / (((x * y) * z) * z);
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	tmp = 0
                	if z <= 1.0:
                		tmp = (1.0 / x) / y
                	elif z <= 1e+141:
                		tmp = 1.0 / (((z * z) * x) * y)
                	else:
                		tmp = 1.0 / (((x * y) * z) * z)
                	return tmp
                
                function code(x, y, z)
                	tmp = 0.0
                	if (z <= 1.0)
                		tmp = Float64(Float64(1.0 / x) / y);
                	elseif (z <= 1e+141)
                		tmp = Float64(1.0 / Float64(Float64(Float64(z * z) * x) * y));
                	else
                		tmp = Float64(1.0 / Float64(Float64(Float64(x * y) * z) * z));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	tmp = 0.0;
                	if (z <= 1.0)
                		tmp = (1.0 / x) / y;
                	elseif (z <= 1e+141)
                		tmp = 1.0 / (((z * z) * x) * y);
                	else
                		tmp = 1.0 / (((x * y) * z) * z);
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := If[LessEqual[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1e+141], N[(1.0 / N[(N[(N[(z * z), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq 1:\\
                \;\;\;\;\frac{\frac{1}{x}}{y}\\
                
                \mathbf{elif}\;z \leq 10^{+141}:\\
                \;\;\;\;\frac{1}{\left(\left(z \cdot z\right) \cdot x\right) \cdot y}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if z < 1

                  1. Initial program 93.8%

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

                    \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y}} \]
                  3. Step-by-step derivation
                    1. Applied rewrites71.3%

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

                    if 1 < z < 1.00000000000000002e141

                    1. Initial program 91.1%

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

                      \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
                    3. Step-by-step derivation
                      1. pow2N/A

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
                      9. lift-*.f6491.9

                        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
                      10. pow291.9

                        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                      11. +-commutative91.9

                        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
                      12. pow291.9

                        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                    6. Applied rewrites91.9%

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

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

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

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

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

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

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

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

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

                    if 1.00000000000000002e141 < z

                    1. Initial program 74.3%

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

                      \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
                    3. Step-by-step derivation
                      1. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
                      10. pow273.5

                        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                      11. +-commutative73.5

                        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
                      12. pow273.5

                        \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                    6. Applied rewrites73.5%

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

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

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

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

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

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

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

                        \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
                      7. distribute-lft-outN/A

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

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

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

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

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

                        \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
                      13. lift-*.f6488.3

                        \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
                    9. Applied rewrites88.3%

                      \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
                    10. Taylor expanded in z around inf

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

                        \[\leadsto \frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z} \]
                    12. Recombined 3 regimes into one program.
                    13. Add Preprocessing

                    Alternative 9: 75.6% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\ \end{array} \end{array} \]
                    (FPCore (x y z)
                     :precision binary64
                     (if (<= z 1.0) (/ (/ 1.0 x) y) (/ 1.0 (* (* (* x y) z) z))))
                    double code(double x, double y, double z) {
                    	double tmp;
                    	if (z <= 1.0) {
                    		tmp = (1.0 / x) / y;
                    	} else {
                    		tmp = 1.0 / (((x * y) * z) * z);
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8) :: tmp
                        if (z <= 1.0d0) then
                            tmp = (1.0d0 / x) / y
                        else
                            tmp = 1.0d0 / (((x * y) * z) * z)
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z) {
                    	double tmp;
                    	if (z <= 1.0) {
                    		tmp = (1.0 / x) / y;
                    	} else {
                    		tmp = 1.0 / (((x * y) * z) * z);
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z):
                    	tmp = 0
                    	if z <= 1.0:
                    		tmp = (1.0 / x) / y
                    	else:
                    		tmp = 1.0 / (((x * y) * z) * z)
                    	return tmp
                    
                    function code(x, y, z)
                    	tmp = 0.0
                    	if (z <= 1.0)
                    		tmp = Float64(Float64(1.0 / x) / y);
                    	else
                    		tmp = Float64(1.0 / Float64(Float64(Float64(x * y) * z) * z));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z)
                    	tmp = 0.0;
                    	if (z <= 1.0)
                    		tmp = (1.0 / x) / y;
                    	else
                    		tmp = 1.0 / (((x * y) * z) * z);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_] := If[LessEqual[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;z \leq 1:\\
                    \;\;\;\;\frac{\frac{1}{x}}{y}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1}{\left(\left(x \cdot y\right) \cdot z\right) \cdot z}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if z < 1

                      1. Initial program 93.8%

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

                        \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites71.3%

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

                        if 1 < z

                        1. Initial program 82.4%

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

                          \[\leadsto \frac{\frac{1}{x}}{y \cdot \color{blue}{{z}^{2}}} \]
                        3. Step-by-step derivation
                          1. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{1}{\color{blue}{\left(y \cdot x\right)} \cdot \left(z \cdot z\right)} \]
                          10. pow282.3

                            \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                          11. +-commutative82.3

                            \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(\color{blue}{z} \cdot z\right)} \]
                          12. pow282.3

                            \[\leadsto \frac{1}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)} \]
                        6. Applied rewrites82.3%

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

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

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

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

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

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

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

                            \[\leadsto \frac{1}{\left(\left(x \cdot y + x \cdot \frac{y}{{z}^{2}}\right) \cdot z\right) \cdot z} \]
                          7. distribute-lft-outN/A

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

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

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

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

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

                            \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
                          13. lift-*.f6490.9

                            \[\leadsto \frac{1}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z} \]
                        9. Applied rewrites90.9%

                          \[\leadsto \frac{1}{\color{blue}{\left(\left(x \cdot \left(\frac{y}{z \cdot z} + y\right)\right) \cdot z\right) \cdot z}} \]
                        10. Taylor expanded in z around inf

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

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

                        Alternative 10: 75.6% accurate, 1.0× speedup?

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

                          1. Initial program 93.8%

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

                            \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y}} \]
                          3. Step-by-step derivation
                            1. Applied rewrites71.3%

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

                            if 1 < z

                            1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{\frac{1}{x}}{1 + \color{blue}{{z}^{2}}}}{y} \]
                              12. +-commutativeN/A

                                \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{{z}^{2} + 1}}}{y} \]
                              13. pow2N/A

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

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

                              \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{fma}\left(z, z, 1\right)}}{y}} \]
                            4. Taylor expanded in z around inf

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

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

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

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

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

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

                                \[\leadsto \frac{1}{\left(\left(y \cdot z\right) \cdot z\right) \cdot x} \]
                              7. lift-*.f6488.8

                                \[\leadsto \frac{1}{\left(\left(y \cdot z\right) \cdot z\right) \cdot x} \]
                            6. Applied rewrites88.8%

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

                          Alternative 11: 73.8% accurate, 1.0× speedup?

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

                            1. Initial program 93.8%

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

                              \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y}} \]
                            3. Step-by-step derivation
                              1. Applied rewrites71.3%

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

                              if 1 < z

                              1. Initial program 82.4%

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

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

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

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

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

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

                                  \[\leadsto \frac{1}{\left({z}^{2} \cdot y\right) \cdot x} \]
                                6. pow2N/A

                                  \[\leadsto \frac{1}{\left(\left(z \cdot z\right) \cdot y\right) \cdot x} \]
                                7. lift-*.f6481.5

                                  \[\leadsto \frac{1}{\left(\left(z \cdot z\right) \cdot y\right) \cdot x} \]
                              4. Applied rewrites81.5%

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

                            Alternative 12: 58.2% accurate, 2.2× speedup?

                            \[\begin{array}{l} \\ \frac{1}{y \cdot x} \end{array} \]
                            (FPCore (x y z) :precision binary64 (/ 1.0 (* y x)))
                            double code(double x, double y, double z) {
                            	return 1.0 / (y * x);
                            }
                            
                            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 = 1.0d0 / (y * x)
                            end function
                            
                            public static double code(double x, double y, double z) {
                            	return 1.0 / (y * x);
                            }
                            
                            def code(x, y, z):
                            	return 1.0 / (y * x)
                            
                            function code(x, y, z)
                            	return Float64(1.0 / Float64(y * x))
                            end
                            
                            function tmp = code(x, y, z)
                            	tmp = 1.0 / (y * x);
                            end
                            
                            code[x_, y_, z_] := N[(1.0 / N[(y * x), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{1}{y \cdot x}
                            \end{array}
                            
                            Derivation
                            1. Initial program 91.0%

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

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

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

                                \[\leadsto \frac{1}{y \cdot \color{blue}{x}} \]
                              3. lower-*.f6458.2

                                \[\leadsto \frac{1}{y \cdot \color{blue}{x}} \]
                            4. Applied rewrites58.2%

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

                            Reproduce

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