Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, B

Percentage Accurate: 99.8% → 99.8%
Time: 4.7s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot 3\right) \cdot y - z \end{array} \]
(FPCore (x y z) :precision binary64 (- (* (* x 3.0) y) z))
double code(double x, double y, double z) {
	return ((x * 3.0) * y) - 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 = ((x * 3.0d0) * y) - z
end function
public static double code(double x, double y, double z) {
	return ((x * 3.0) * y) - z;
}
def code(x, y, z):
	return ((x * 3.0) * y) - z
function code(x, y, z)
	return Float64(Float64(Float64(x * 3.0) * y) - z)
end
function tmp = code(x, y, z)
	tmp = ((x * 3.0) * y) - z;
end
code[x_, y_, z_] := N[(N[(N[(x * 3.0), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot 3\right) \cdot y - z
\end{array}

Sampling outcomes in binary64 precision:

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x \cdot 3\right) \cdot y - z \end{array} \]
(FPCore (x y z) :precision binary64 (- (* (* x 3.0) y) z))
double code(double x, double y, double z) {
	return ((x * 3.0) * y) - 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 = ((x * 3.0d0) * y) - z
end function
public static double code(double x, double y, double z) {
	return ((x * 3.0) * y) - z;
}
def code(x, y, z):
	return ((x * 3.0) * y) - z
function code(x, y, z)
	return Float64(Float64(Float64(x * 3.0) * y) - z)
end
function tmp = code(x, y, z)
	tmp = ((x * 3.0) * y) - z;
end
code[x_, y_, z_] := N[(N[(N[(x * 3.0), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot 3\right) \cdot y - z
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

    \[\left(x \cdot 3\right) \cdot y - z \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot 3 - z \]
    8. lower-*.f6499.9

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

    \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot 3} - z \]
  5. Applied rewrites99.9%

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

Alternative 2: 77.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x \cdot 3\right) \cdot y\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+140} \lor \neg \left(t\_0 \leq 10^{+40}\right):\\ \;\;\;\;\left(3 \cdot x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (* x 3.0) y)))
   (if (or (<= t_0 -2e+140) (not (<= t_0 1e+40))) (* (* 3.0 x) y) (- z))))
double code(double x, double y, double z) {
	double t_0 = (x * 3.0) * y;
	double tmp;
	if ((t_0 <= -2e+140) || !(t_0 <= 1e+40)) {
		tmp = (3.0 * x) * y;
	} else {
		tmp = -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) :: t_0
    real(8) :: tmp
    t_0 = (x * 3.0d0) * y
    if ((t_0 <= (-2d+140)) .or. (.not. (t_0 <= 1d+40))) then
        tmp = (3.0d0 * x) * y
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = (x * 3.0) * y;
	double tmp;
	if ((t_0 <= -2e+140) || !(t_0 <= 1e+40)) {
		tmp = (3.0 * x) * y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x * 3.0) * y
	tmp = 0
	if (t_0 <= -2e+140) or not (t_0 <= 1e+40):
		tmp = (3.0 * x) * y
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(x * 3.0) * y)
	tmp = 0.0
	if ((t_0 <= -2e+140) || !(t_0 <= 1e+40))
		tmp = Float64(Float64(3.0 * x) * y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (x * 3.0) * y;
	tmp = 0.0;
	if ((t_0 <= -2e+140) || ~((t_0 <= 1e+40)))
		tmp = (3.0 * x) * y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 3.0), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e+140], N[Not[LessEqual[t$95$0, 1e+40]], $MachinePrecision]], N[(N[(3.0 * x), $MachinePrecision] * y), $MachinePrecision], (-z)]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x \cdot 3\right) \cdot y\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+140} \lor \neg \left(t\_0 \leq 10^{+40}\right):\\
\;\;\;\;\left(3 \cdot x\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;-z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 x #s(literal 3 binary64)) y) < -2.00000000000000012e140 or 1.00000000000000003e40 < (*.f64 (*.f64 x #s(literal 3 binary64)) y)

    1. Initial program 98.8%

      \[\left(x \cdot 3\right) \cdot y - z \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{3 \cdot \left(x \cdot y\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites85.2%

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

          \[\leadsto \left(3 \cdot x\right) \cdot \color{blue}{y} \]

        if -2.00000000000000012e140 < (*.f64 (*.f64 x #s(literal 3 binary64)) y) < 1.00000000000000003e40

        1. Initial program 99.9%

          \[\left(x \cdot 3\right) \cdot y - z \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{-1 \cdot z} \]
        4. Step-by-step derivation
          1. Applied rewrites77.6%

            \[\leadsto \color{blue}{-z} \]
        5. Recombined 2 regimes into one program.
        6. Final simplification80.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot 3\right) \cdot y \leq -2 \cdot 10^{+140} \lor \neg \left(\left(x \cdot 3\right) \cdot y \leq 10^{+40}\right):\\ \;\;\;\;\left(3 \cdot x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
        7. Add Preprocessing

        Alternative 3: 77.1% accurate, 0.3× speedup?

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

          1. Initial program 97.8%

            \[\left(x \cdot 3\right) \cdot y - z \]
          2. Add Preprocessing
          3. Taylor expanded in x around inf

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

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

                \[\leadsto \left(3 \cdot x\right) \cdot \color{blue}{y} \]

              if -2.00000000000000012e140 < (*.f64 (*.f64 x #s(literal 3 binary64)) y) < 1.00000000000000003e40

              1. Initial program 99.9%

                \[\left(x \cdot 3\right) \cdot y - z \]
              2. Add Preprocessing
              3. Taylor expanded in x around 0

                \[\leadsto \color{blue}{-1 \cdot z} \]
              4. Step-by-step derivation
                1. Applied rewrites77.6%

                  \[\leadsto \color{blue}{-z} \]

                if 1.00000000000000003e40 < (*.f64 (*.f64 x #s(literal 3 binary64)) y)

                1. Initial program 99.7%

                  \[\left(x \cdot 3\right) \cdot y - z \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

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

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

                Alternative 4: 77.1% accurate, 0.3× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x \cdot 3\right) \cdot y\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+140}:\\ \;\;\;\;\left(3 \cdot x\right) \cdot y\\ \mathbf{elif}\;t\_0 \leq 10^{+40}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\left(3 \cdot y\right) \cdot x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (let* ((t_0 (* (* x 3.0) y)))
                   (if (<= t_0 -2e+140)
                     (* (* 3.0 x) y)
                     (if (<= t_0 1e+40) (- z) (* (* 3.0 y) x)))))
                double code(double x, double y, double z) {
                	double t_0 = (x * 3.0) * y;
                	double tmp;
                	if (t_0 <= -2e+140) {
                		tmp = (3.0 * x) * y;
                	} else if (t_0 <= 1e+40) {
                		tmp = -z;
                	} else {
                		tmp = (3.0 * 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) :: t_0
                    real(8) :: tmp
                    t_0 = (x * 3.0d0) * y
                    if (t_0 <= (-2d+140)) then
                        tmp = (3.0d0 * x) * y
                    else if (t_0 <= 1d+40) then
                        tmp = -z
                    else
                        tmp = (3.0d0 * y) * x
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double t_0 = (x * 3.0) * y;
                	double tmp;
                	if (t_0 <= -2e+140) {
                		tmp = (3.0 * x) * y;
                	} else if (t_0 <= 1e+40) {
                		tmp = -z;
                	} else {
                		tmp = (3.0 * y) * x;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	t_0 = (x * 3.0) * y
                	tmp = 0
                	if t_0 <= -2e+140:
                		tmp = (3.0 * x) * y
                	elif t_0 <= 1e+40:
                		tmp = -z
                	else:
                		tmp = (3.0 * y) * x
                	return tmp
                
                function code(x, y, z)
                	t_0 = Float64(Float64(x * 3.0) * y)
                	tmp = 0.0
                	if (t_0 <= -2e+140)
                		tmp = Float64(Float64(3.0 * x) * y);
                	elseif (t_0 <= 1e+40)
                		tmp = Float64(-z);
                	else
                		tmp = Float64(Float64(3.0 * y) * x);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	t_0 = (x * 3.0) * y;
                	tmp = 0.0;
                	if (t_0 <= -2e+140)
                		tmp = (3.0 * x) * y;
                	elseif (t_0 <= 1e+40)
                		tmp = -z;
                	else
                		tmp = (3.0 * y) * x;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 3.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+140], N[(N[(3.0 * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e+40], (-z), N[(N[(3.0 * y), $MachinePrecision] * x), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \left(x \cdot 3\right) \cdot y\\
                \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+140}:\\
                \;\;\;\;\left(3 \cdot x\right) \cdot y\\
                
                \mathbf{elif}\;t\_0 \leq 10^{+40}:\\
                \;\;\;\;-z\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(3 \cdot y\right) \cdot x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.f64 (*.f64 x #s(literal 3 binary64)) y) < -2.00000000000000012e140

                  1. Initial program 97.8%

                    \[\left(x \cdot 3\right) \cdot y - z \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around inf

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

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

                        \[\leadsto \left(3 \cdot x\right) \cdot \color{blue}{y} \]

                      if -2.00000000000000012e140 < (*.f64 (*.f64 x #s(literal 3 binary64)) y) < 1.00000000000000003e40

                      1. Initial program 99.9%

                        \[\left(x \cdot 3\right) \cdot y - z \]
                      2. Add Preprocessing
                      3. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{-1 \cdot z} \]
                      4. Step-by-step derivation
                        1. Applied rewrites77.6%

                          \[\leadsto \color{blue}{-z} \]

                        if 1.00000000000000003e40 < (*.f64 (*.f64 x #s(literal 3 binary64)) y)

                        1. Initial program 99.7%

                          \[\left(x \cdot 3\right) \cdot y - z \]
                        2. Add Preprocessing
                        3. Taylor expanded in x around inf

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

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

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

                          Alternative 5: 99.8% accurate, 1.0× speedup?

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

                            \[\left(x \cdot 3\right) \cdot y - z \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-*.f64N/A

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot 3 - z \]
                            8. lower-*.f6499.9

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

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

                          Alternative 6: 99.8% accurate, 1.0× speedup?

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

                            \[\left(x \cdot 3\right) \cdot y - z \]
                          2. Add Preprocessing
                          3. Add Preprocessing

                          Alternative 7: 99.8% accurate, 1.0× speedup?

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

                            \[\left(x \cdot 3\right) \cdot y - z \]
                          2. Add Preprocessing
                          3. Taylor expanded in x around 0

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

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

                          Alternative 8: 51.2% accurate, 4.7× speedup?

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

                            \[\left(x \cdot 3\right) \cdot y - z \]
                          2. Add Preprocessing
                          3. Taylor expanded in x around 0

                            \[\leadsto \color{blue}{-1 \cdot z} \]
                          4. Step-by-step derivation
                            1. Applied rewrites53.2%

                              \[\leadsto \color{blue}{-z} \]
                            2. Add Preprocessing

                            Developer Target 1: 99.8% accurate, 1.0× speedup?

                            \[\begin{array}{l} \\ x \cdot \left(3 \cdot y\right) - z \end{array} \]
                            (FPCore (x y z) :precision binary64 (- (* x (* 3.0 y)) z))
                            double code(double x, double y, double z) {
                            	return (x * (3.0 * y)) - 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 = (x * (3.0d0 * y)) - z
                            end function
                            
                            public static double code(double x, double y, double z) {
                            	return (x * (3.0 * y)) - z;
                            }
                            
                            def code(x, y, z):
                            	return (x * (3.0 * y)) - z
                            
                            function code(x, y, z)
                            	return Float64(Float64(x * Float64(3.0 * y)) - z)
                            end
                            
                            function tmp = code(x, y, z)
                            	tmp = (x * (3.0 * y)) - z;
                            end
                            
                            code[x_, y_, z_] := N[(N[(x * N[(3.0 * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            x \cdot \left(3 \cdot y\right) - z
                            \end{array}
                            

                            Reproduce

                            ?
                            herbie shell --seed 2025021 
                            (FPCore (x y z)
                              :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, B"
                              :precision binary64
                            
                              :alt
                              (! :herbie-platform default (- (* x (* 3 y)) z))
                            
                              (- (* (* x 3.0) y) z))