Q^3 (Cubic Equation Discriminant Part)

Percentage Accurate: 81.1% → 99.3%
Time: 5.3s
Alternatives: 17
Speedup: 2.6×

Specification

?
\[\left(\left(-1000000000 \leq a \land a \leq 1000000000\right) \land \left(-1000000000 \leq b \land b \leq 1000000000\right)\right) \land \left(-1000000000 \leq c \land c \leq 1000000000\right)\]
\[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
(FPCore (a b c)
  :precision binary64
  (pow (/ (- (* 3.0 (* a c)) (pow b 2.0)) (* 9.0 (pow a 2.0))) 3.0))
double code(double a, double b, double c) {
	return pow((((3.0 * (a * c)) - pow(b, 2.0)) / (9.0 * pow(a, 2.0))), 3.0);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((3.0d0 * (a * c)) - (b ** 2.0d0)) / (9.0d0 * (a ** 2.0d0))) ** 3.0d0
end function
public static double code(double a, double b, double c) {
	return Math.pow((((3.0 * (a * c)) - Math.pow(b, 2.0)) / (9.0 * Math.pow(a, 2.0))), 3.0);
}
def code(a, b, c):
	return math.pow((((3.0 * (a * c)) - math.pow(b, 2.0)) / (9.0 * math.pow(a, 2.0))), 3.0)
function code(a, b, c)
	return Float64(Float64(Float64(3.0 * Float64(a * c)) - (b ^ 2.0)) / Float64(9.0 * (a ^ 2.0))) ^ 3.0
end
function tmp = code(a, b, c)
	tmp = (((3.0 * (a * c)) - (b ^ 2.0)) / (9.0 * (a ^ 2.0))) ^ 3.0;
end
code[a_, b_, c_] := N[Power[N[(N[(N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision] - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] / N[(9.0 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]
{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}

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

\[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
(FPCore (a b c)
  :precision binary64
  (pow (/ (- (* 3.0 (* a c)) (pow b 2.0)) (* 9.0 (pow a 2.0))) 3.0))
double code(double a, double b, double c) {
	return pow((((3.0 * (a * c)) - pow(b, 2.0)) / (9.0 * pow(a, 2.0))), 3.0);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((3.0d0 * (a * c)) - (b ** 2.0d0)) / (9.0d0 * (a ** 2.0d0))) ** 3.0d0
end function
public static double code(double a, double b, double c) {
	return Math.pow((((3.0 * (a * c)) - Math.pow(b, 2.0)) / (9.0 * Math.pow(a, 2.0))), 3.0);
}
def code(a, b, c):
	return math.pow((((3.0 * (a * c)) - math.pow(b, 2.0)) / (9.0 * math.pow(a, 2.0))), 3.0)
function code(a, b, c)
	return Float64(Float64(Float64(3.0 * Float64(a * c)) - (b ^ 2.0)) / Float64(9.0 * (a ^ 2.0))) ^ 3.0
end
function tmp = code(a, b, c)
	tmp = (((3.0 * (a * c)) - (b ^ 2.0)) / (9.0 * (a ^ 2.0))) ^ 3.0;
end
code[a_, b_, c_] := N[Power[N[(N[(N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision] - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] / N[(9.0 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]
{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}

Alternative 1: 99.3% accurate, 2.5× speedup?

\[\begin{array}{l} t_0 := \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\\ \left(t\_0 \cdot t\_0\right) \cdot t\_0 \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0
        (/
         (-
          (* -0.1111111111111111 (* (/ b a) b))
          (* -0.3333333333333333 c))
         a)))
  (* (* t_0 t_0) t_0)))
double code(double a, double b, double c) {
	double t_0 = ((-0.1111111111111111 * ((b / a) * b)) - (-0.3333333333333333 * c)) / a;
	return (t_0 * t_0) * t_0;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    t_0 = (((-0.1111111111111111d0) * ((b / a) * b)) - ((-0.3333333333333333d0) * c)) / a
    code = (t_0 * t_0) * t_0
end function
public static double code(double a, double b, double c) {
	double t_0 = ((-0.1111111111111111 * ((b / a) * b)) - (-0.3333333333333333 * c)) / a;
	return (t_0 * t_0) * t_0;
}
def code(a, b, c):
	t_0 = ((-0.1111111111111111 * ((b / a) * b)) - (-0.3333333333333333 * c)) / a
	return (t_0 * t_0) * t_0
function code(a, b, c)
	t_0 = Float64(Float64(Float64(-0.1111111111111111 * Float64(Float64(b / a) * b)) - Float64(-0.3333333333333333 * c)) / a)
	return Float64(Float64(t_0 * t_0) * t_0)
end
function tmp = code(a, b, c)
	t_0 = ((-0.1111111111111111 * ((b / a) * b)) - (-0.3333333333333333 * c)) / a;
	tmp = (t_0 * t_0) * t_0;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[(-0.1111111111111111 * N[(N[(b / a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(-0.3333333333333333 * c), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, N[(N[(t$95$0 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\\
\left(t\_0 \cdot t\_0\right) \cdot t\_0
\end{array}
Derivation
  1. Initial program 81.1%

    \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
  2. Taylor expanded in a around inf

    \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
  3. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
    2. lower-+.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    3. lower-*.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    4. lower-/.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    5. lower-pow.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. lower-*.f6494.0%

      \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
  4. Applied rewrites94.0%

    \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
  5. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    2. +-commutativeN/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c + \frac{-1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    3. lift-*.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c + \frac{-1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    4. fp-cancel-sign-sub-invN/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \left(\mathsf{neg}\left(\frac{-1}{9}\right)\right) \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    5. lower--.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \left(\mathsf{neg}\left(\frac{-1}{9}\right)\right) \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    6. metadata-evalN/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    7. lower-*.f6494.0%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    8. lift-/.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    9. lift-pow.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    10. pow2N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{b \cdot b}{a}}{a}\right)}^{3} \]
    11. associate-/l*N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
    12. lower-*.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
    13. lower-/.f6499.3%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
  6. Applied rewrites99.3%

    \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
  7. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3}} \]
    2. unpow3N/A

      \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a} \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right) \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}} \]
    3. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a} \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right) \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}} \]
  8. Applied rewrites99.3%

    \[\leadsto \color{blue}{\left(\frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}} \]
  9. Add Preprocessing

Alternative 2: 92.7% accurate, 1.4× speedup?

\[\begin{array}{l} t_0 := \frac{\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot \left(b \cdot b\right)}{a \cdot a}\\ \mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{-305}:\\ \;\;\;\;{\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 \cdot t\_0\right) \cdot t\_0\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0
        (/
         (-
          (* (* c a) 0.3333333333333333)
          (* 0.1111111111111111 (* b b)))
         (* a a))))
  (if (<= (pow b 2.0) 2e-305)
    (pow (/ (* 0.3333333333333333 c) a) 3.0)
    (* (* t_0 t_0) t_0))))
double code(double a, double b, double c) {
	double t_0 = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * (b * b))) / (a * a);
	double tmp;
	if (pow(b, 2.0) <= 2e-305) {
		tmp = pow(((0.3333333333333333 * c) / a), 3.0);
	} else {
		tmp = (t_0 * t_0) * t_0;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (((c * a) * 0.3333333333333333d0) - (0.1111111111111111d0 * (b * b))) / (a * a)
    if ((b ** 2.0d0) <= 2d-305) then
        tmp = ((0.3333333333333333d0 * c) / a) ** 3.0d0
    else
        tmp = (t_0 * t_0) * t_0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * (b * b))) / (a * a);
	double tmp;
	if (Math.pow(b, 2.0) <= 2e-305) {
		tmp = Math.pow(((0.3333333333333333 * c) / a), 3.0);
	} else {
		tmp = (t_0 * t_0) * t_0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * (b * b))) / (a * a)
	tmp = 0
	if math.pow(b, 2.0) <= 2e-305:
		tmp = math.pow(((0.3333333333333333 * c) / a), 3.0)
	else:
		tmp = (t_0 * t_0) * t_0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(Float64(Float64(c * a) * 0.3333333333333333) - Float64(0.1111111111111111 * Float64(b * b))) / Float64(a * a))
	tmp = 0.0
	if ((b ^ 2.0) <= 2e-305)
		tmp = Float64(Float64(0.3333333333333333 * c) / a) ^ 3.0;
	else
		tmp = Float64(Float64(t_0 * t_0) * t_0);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * (b * b))) / (a * a);
	tmp = 0.0;
	if ((b ^ 2.0) <= 2e-305)
		tmp = ((0.3333333333333333 * c) / a) ^ 3.0;
	else
		tmp = (t_0 * t_0) * t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[(N[(c * a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - N[(0.1111111111111111 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e-305], N[Power[N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision], 3.0], $MachinePrecision], N[(N[(t$95$0 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot \left(b \cdot b\right)}{a \cdot a}\\
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{-305}:\\
\;\;\;\;{\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3}\\

\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot t\_0\right) \cdot t\_0\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 b #s(literal 2 binary64)) < 2e-305

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]

    if 2e-305 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a} \cdot \frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a} \cdot \frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}} \]
    6. Applied rewrites81.1%

      \[\leadsto \color{blue}{\left(\frac{\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot \left(b \cdot b\right)}{a \cdot a} \cdot \frac{\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot \left(b \cdot b\right)}{a \cdot a}\right) \cdot \frac{\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot \left(b \cdot b\right)}{a \cdot a}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 90.0% accurate, 2.3× speedup?

\[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ \mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\ \;\;\;\;{\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(c \cdot a\right) \cdot 3 - t\_0\right) \cdot \frac{\frac{0.012345679012345678 \cdot \left(\left(c \cdot 3\right) \cdot a - t\_0\right)}{a \cdot a}}{a \cdot a}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (fabs b) (fabs b))))
  (if (<= (fabs b) 4.5e-153)
    (pow (/ (* 0.3333333333333333 c) a) 3.0)
    (*
     (/
      (*
       (- (* (* c a) 3.0) t_0)
       (/
        (/ (* 0.012345679012345678 (- (* (* c 3.0) a) t_0)) (* a a))
        (* a a)))
      (* a a))
     (- (* (* c a) 0.3333333333333333) (* t_0 0.1111111111111111))))))
double code(double a, double b, double c) {
	double t_0 = fabs(b) * fabs(b);
	double tmp;
	if (fabs(b) <= 4.5e-153) {
		tmp = pow(((0.3333333333333333 * c) / a), 3.0);
	} else {
		tmp = (((((c * a) * 3.0) - t_0) * (((0.012345679012345678 * (((c * 3.0) * a) - t_0)) / (a * a)) / (a * a))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs(b) * abs(b)
    if (abs(b) <= 4.5d-153) then
        tmp = ((0.3333333333333333d0 * c) / a) ** 3.0d0
    else
        tmp = (((((c * a) * 3.0d0) - t_0) * (((0.012345679012345678d0 * (((c * 3.0d0) * a) - t_0)) / (a * a)) / (a * a))) / (a * a)) * (((c * a) * 0.3333333333333333d0) - (t_0 * 0.1111111111111111d0))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.abs(b) * Math.abs(b);
	double tmp;
	if (Math.abs(b) <= 4.5e-153) {
		tmp = Math.pow(((0.3333333333333333 * c) / a), 3.0);
	} else {
		tmp = (((((c * a) * 3.0) - t_0) * (((0.012345679012345678 * (((c * 3.0) * a) - t_0)) / (a * a)) / (a * a))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.fabs(b) * math.fabs(b)
	tmp = 0
	if math.fabs(b) <= 4.5e-153:
		tmp = math.pow(((0.3333333333333333 * c) / a), 3.0)
	else:
		tmp = (((((c * a) * 3.0) - t_0) * (((0.012345679012345678 * (((c * 3.0) * a) - t_0)) / (a * a)) / (a * a))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111))
	return tmp
function code(a, b, c)
	t_0 = Float64(abs(b) * abs(b))
	tmp = 0.0
	if (abs(b) <= 4.5e-153)
		tmp = Float64(Float64(0.3333333333333333 * c) / a) ^ 3.0;
	else
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(c * a) * 3.0) - t_0) * Float64(Float64(Float64(0.012345679012345678 * Float64(Float64(Float64(c * 3.0) * a) - t_0)) / Float64(a * a)) / Float64(a * a))) / Float64(a * a)) * Float64(Float64(Float64(c * a) * 0.3333333333333333) - Float64(t_0 * 0.1111111111111111)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = abs(b) * abs(b);
	tmp = 0.0;
	if (abs(b) <= 4.5e-153)
		tmp = ((0.3333333333333333 * c) / a) ^ 3.0;
	else
		tmp = (((((c * a) * 3.0) - t_0) * (((0.012345679012345678 * (((c * 3.0) * a) - t_0)) / (a * a)) / (a * a))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 4.5e-153], N[Power[N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision], 3.0], $MachinePrecision], N[(N[(N[(N[(N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision] - t$95$0), $MachinePrecision] * N[(N[(N[(0.012345679012345678 * N[(N[(N[(c * 3.0), $MachinePrecision] * a), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c * a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - N[(t$95$0 * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| \cdot \left|b\right|\\
\mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\
\;\;\;\;{\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(c \cdot a\right) \cdot 3 - t\_0\right) \cdot \frac{\frac{0.012345679012345678 \cdot \left(\left(c \cdot 3\right) \cdot a - t\_0\right)}{a \cdot a}}{a \cdot a}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.5e-153

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]

    if 4.5e-153 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.2%

      \[\leadsto \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)} \]
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      3. associate-*r/N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      5. associate-/r*N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{a \cdot a}}{a \cdot a}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{a \cdot a}}{a \cdot a}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
    4. Applied rewrites76.2%

      \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{0.012345679012345678 \cdot \left(\left(c \cdot 3\right) \cdot a - b \cdot b\right)}{a \cdot a}}{a \cdot a}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 88.9% accurate, 2.4× speedup?

\[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ \mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\ \;\;\;\;{\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(c \cdot a\right) \cdot 3 - t\_0\right) \cdot \left(\left(c \cdot 3 - \frac{\left|b\right|}{a} \cdot \left|b\right|\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot a}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (fabs b) (fabs b))))
  (if (<= (fabs b) 4.5e-153)
    (pow (/ (* 0.3333333333333333 c) a) 3.0)
    (*
     (/
      (*
       (- (* (* c a) 3.0) t_0)
       (*
        (- (* c 3.0) (* (/ (fabs b) a) (fabs b)))
        (/ 0.012345679012345678 (* (* a a) a))))
      (* a a))
     (- (* (* c a) 0.3333333333333333) (* t_0 0.1111111111111111))))))
double code(double a, double b, double c) {
	double t_0 = fabs(b) * fabs(b);
	double tmp;
	if (fabs(b) <= 4.5e-153) {
		tmp = pow(((0.3333333333333333 * c) / a), 3.0);
	} else {
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((fabs(b) / a) * fabs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs(b) * abs(b)
    if (abs(b) <= 4.5d-153) then
        tmp = ((0.3333333333333333d0 * c) / a) ** 3.0d0
    else
        tmp = (((((c * a) * 3.0d0) - t_0) * (((c * 3.0d0) - ((abs(b) / a) * abs(b))) * (0.012345679012345678d0 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333d0) - (t_0 * 0.1111111111111111d0))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.abs(b) * Math.abs(b);
	double tmp;
	if (Math.abs(b) <= 4.5e-153) {
		tmp = Math.pow(((0.3333333333333333 * c) / a), 3.0);
	} else {
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((Math.abs(b) / a) * Math.abs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.fabs(b) * math.fabs(b)
	tmp = 0
	if math.fabs(b) <= 4.5e-153:
		tmp = math.pow(((0.3333333333333333 * c) / a), 3.0)
	else:
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((math.fabs(b) / a) * math.fabs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111))
	return tmp
function code(a, b, c)
	t_0 = Float64(abs(b) * abs(b))
	tmp = 0.0
	if (abs(b) <= 4.5e-153)
		tmp = Float64(Float64(0.3333333333333333 * c) / a) ^ 3.0;
	else
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(c * a) * 3.0) - t_0) * Float64(Float64(Float64(c * 3.0) - Float64(Float64(abs(b) / a) * abs(b))) * Float64(0.012345679012345678 / Float64(Float64(a * a) * a)))) / Float64(a * a)) * Float64(Float64(Float64(c * a) * 0.3333333333333333) - Float64(t_0 * 0.1111111111111111)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = abs(b) * abs(b);
	tmp = 0.0;
	if (abs(b) <= 4.5e-153)
		tmp = ((0.3333333333333333 * c) / a) ^ 3.0;
	else
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((abs(b) / a) * abs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 4.5e-153], N[Power[N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision], 3.0], $MachinePrecision], N[(N[(N[(N[(N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision] - t$95$0), $MachinePrecision] * N[(N[(N[(c * 3.0), $MachinePrecision] - N[(N[(N[Abs[b], $MachinePrecision] / a), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.012345679012345678 / N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c * a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - N[(t$95$0 * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| \cdot \left|b\right|\\
\mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\
\;\;\;\;{\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(c \cdot a\right) \cdot 3 - t\_0\right) \cdot \left(\left(c \cdot 3 - \frac{\left|b\right|}{a} \cdot \left|b\right|\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot a}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.5e-153

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]

    if 4.5e-153 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.2%

      \[\leadsto \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)} \]
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      3. associate-*r/N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\left(a \cdot a\right) \cdot \color{blue}{\left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      6. associate-*r*N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{\left(\left(a \cdot a\right) \cdot a\right) \cdot a}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{\left(\left(a \cdot a\right) \cdot a\right)} \cdot a}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{a \cdot \left(\left(a \cdot a\right) \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      9. times-fracN/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a} \cdot \frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot a}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a} \cdot \frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot a}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
    4. Applied rewrites71.6%

      \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\left(c \cdot 3 - \frac{b}{a} \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot a}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 88.9% accurate, 2.4× speedup?

\[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ t_1 := \frac{0.3333333333333333 \cdot c}{a}\\ \mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\ \;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(c \cdot a\right) \cdot 3 - t\_0\right) \cdot \left(\left(c \cdot 3 - \frac{\left|b\right|}{a} \cdot \left|b\right|\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot a}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (fabs b) (fabs b)))
       (t_1 (/ (* 0.3333333333333333 c) a)))
  (if (<= (fabs b) 4.5e-153)
    (* (* t_1 t_1) t_1)
    (*
     (/
      (*
       (- (* (* c a) 3.0) t_0)
       (*
        (- (* c 3.0) (* (/ (fabs b) a) (fabs b)))
        (/ 0.012345679012345678 (* (* a a) a))))
      (* a a))
     (- (* (* c a) 0.3333333333333333) (* t_0 0.1111111111111111))))))
double code(double a, double b, double c) {
	double t_0 = fabs(b) * fabs(b);
	double t_1 = (0.3333333333333333 * c) / a;
	double tmp;
	if (fabs(b) <= 4.5e-153) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((fabs(b) / a) * fabs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = abs(b) * abs(b)
    t_1 = (0.3333333333333333d0 * c) / a
    if (abs(b) <= 4.5d-153) then
        tmp = (t_1 * t_1) * t_1
    else
        tmp = (((((c * a) * 3.0d0) - t_0) * (((c * 3.0d0) - ((abs(b) / a) * abs(b))) * (0.012345679012345678d0 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333d0) - (t_0 * 0.1111111111111111d0))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.abs(b) * Math.abs(b);
	double t_1 = (0.3333333333333333 * c) / a;
	double tmp;
	if (Math.abs(b) <= 4.5e-153) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((Math.abs(b) / a) * Math.abs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.fabs(b) * math.fabs(b)
	t_1 = (0.3333333333333333 * c) / a
	tmp = 0
	if math.fabs(b) <= 4.5e-153:
		tmp = (t_1 * t_1) * t_1
	else:
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((math.fabs(b) / a) * math.fabs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111))
	return tmp
function code(a, b, c)
	t_0 = Float64(abs(b) * abs(b))
	t_1 = Float64(Float64(0.3333333333333333 * c) / a)
	tmp = 0.0
	if (abs(b) <= 4.5e-153)
		tmp = Float64(Float64(t_1 * t_1) * t_1);
	else
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(c * a) * 3.0) - t_0) * Float64(Float64(Float64(c * 3.0) - Float64(Float64(abs(b) / a) * abs(b))) * Float64(0.012345679012345678 / Float64(Float64(a * a) * a)))) / Float64(a * a)) * Float64(Float64(Float64(c * a) * 0.3333333333333333) - Float64(t_0 * 0.1111111111111111)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = abs(b) * abs(b);
	t_1 = (0.3333333333333333 * c) / a;
	tmp = 0.0;
	if (abs(b) <= 4.5e-153)
		tmp = (t_1 * t_1) * t_1;
	else
		tmp = (((((c * a) * 3.0) - t_0) * (((c * 3.0) - ((abs(b) / a) * abs(b))) * (0.012345679012345678 / ((a * a) * a)))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 4.5e-153], N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(N[(N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision] - t$95$0), $MachinePrecision] * N[(N[(N[(c * 3.0), $MachinePrecision] - N[(N[(N[Abs[b], $MachinePrecision] / a), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.012345679012345678 / N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c * a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - N[(t$95$0 * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left|b\right| \cdot \left|b\right|\\
t_1 := \frac{0.3333333333333333 \cdot c}{a}\\
\mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\
\;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(c \cdot a\right) \cdot 3 - t\_0\right) \cdot \left(\left(c \cdot 3 - \frac{\left|b\right|}{a} \cdot \left|b\right|\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot a}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.5e-153

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 4.5e-153 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.2%

      \[\leadsto \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)} \]
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      3. associate-*r/N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\left(a \cdot a\right) \cdot \color{blue}{\left(a \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      6. associate-*r*N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{\left(\left(a \cdot a\right) \cdot a\right) \cdot a}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{\left(\left(a \cdot a\right) \cdot a\right)} \cdot a}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{81}}{\color{blue}{a \cdot \left(\left(a \cdot a\right) \cdot a\right)}}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      9. times-fracN/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a} \cdot \frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot a}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a} \cdot \frac{\frac{1}{81}}{\left(a \cdot a\right) \cdot a}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot \frac{1}{3} - \left(b \cdot b\right) \cdot \frac{1}{9}\right) \]
    4. Applied rewrites71.6%

      \[\leadsto \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\left(c \cdot 3 - \frac{b}{a} \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot a}\right)}}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 86.9% accurate, 2.4× speedup?

\[\begin{array}{l} t_0 := \left(c \cdot a\right) \cdot 3\\ t_1 := \left|b\right| \cdot \left|b\right|\\ t_2 := t\_0 - t\_1\\ t_3 := \frac{0.3333333333333333 \cdot c}{a}\\ \mathbf{if}\;\left|b\right| \leq 2.2 \cdot 10^{-131}:\\ \;\;\;\;\left(t\_3 \cdot t\_3\right) \cdot t\_3\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_2}{81 \cdot \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(\left(t\_1 - t\_0\right) \cdot \left(\frac{-0.1111111111111111}{a \cdot a} \cdot t\_2\right)\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (* c a) 3.0))
       (t_1 (* (fabs b) (fabs b)))
       (t_2 (- t_0 t_1))
       (t_3 (/ (* 0.3333333333333333 c) a)))
  (if (<= (fabs b) 2.2e-131)
    (* (* t_3 t_3) t_3)
    (*
     (/ t_2 (* 81.0 (* (* a a) (* a a))))
     (* (- t_1 t_0) (* (/ -0.1111111111111111 (* a a)) t_2))))))
double code(double a, double b, double c) {
	double t_0 = (c * a) * 3.0;
	double t_1 = fabs(b) * fabs(b);
	double t_2 = t_0 - t_1;
	double t_3 = (0.3333333333333333 * c) / a;
	double tmp;
	if (fabs(b) <= 2.2e-131) {
		tmp = (t_3 * t_3) * t_3;
	} else {
		tmp = (t_2 / (81.0 * ((a * a) * (a * a)))) * ((t_1 - t_0) * ((-0.1111111111111111 / (a * a)) * t_2));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (c * a) * 3.0d0
    t_1 = abs(b) * abs(b)
    t_2 = t_0 - t_1
    t_3 = (0.3333333333333333d0 * c) / a
    if (abs(b) <= 2.2d-131) then
        tmp = (t_3 * t_3) * t_3
    else
        tmp = (t_2 / (81.0d0 * ((a * a) * (a * a)))) * ((t_1 - t_0) * (((-0.1111111111111111d0) / (a * a)) * t_2))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * a) * 3.0;
	double t_1 = Math.abs(b) * Math.abs(b);
	double t_2 = t_0 - t_1;
	double t_3 = (0.3333333333333333 * c) / a;
	double tmp;
	if (Math.abs(b) <= 2.2e-131) {
		tmp = (t_3 * t_3) * t_3;
	} else {
		tmp = (t_2 / (81.0 * ((a * a) * (a * a)))) * ((t_1 - t_0) * ((-0.1111111111111111 / (a * a)) * t_2));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * a) * 3.0
	t_1 = math.fabs(b) * math.fabs(b)
	t_2 = t_0 - t_1
	t_3 = (0.3333333333333333 * c) / a
	tmp = 0
	if math.fabs(b) <= 2.2e-131:
		tmp = (t_3 * t_3) * t_3
	else:
		tmp = (t_2 / (81.0 * ((a * a) * (a * a)))) * ((t_1 - t_0) * ((-0.1111111111111111 / (a * a)) * t_2))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * a) * 3.0)
	t_1 = Float64(abs(b) * abs(b))
	t_2 = Float64(t_0 - t_1)
	t_3 = Float64(Float64(0.3333333333333333 * c) / a)
	tmp = 0.0
	if (abs(b) <= 2.2e-131)
		tmp = Float64(Float64(t_3 * t_3) * t_3);
	else
		tmp = Float64(Float64(t_2 / Float64(81.0 * Float64(Float64(a * a) * Float64(a * a)))) * Float64(Float64(t_1 - t_0) * Float64(Float64(-0.1111111111111111 / Float64(a * a)) * t_2)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * a) * 3.0;
	t_1 = abs(b) * abs(b);
	t_2 = t_0 - t_1;
	t_3 = (0.3333333333333333 * c) / a;
	tmp = 0.0;
	if (abs(b) <= 2.2e-131)
		tmp = (t_3 * t_3) * t_3;
	else
		tmp = (t_2 / (81.0 * ((a * a) * (a * a)))) * ((t_1 - t_0) * ((-0.1111111111111111 / (a * a)) * t_2));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.2e-131], N[(N[(t$95$3 * t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision], N[(N[(t$95$2 / N[(81.0 * N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 - t$95$0), $MachinePrecision] * N[(N[(-0.1111111111111111 / N[(a * a), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left(c \cdot a\right) \cdot 3\\
t_1 := \left|b\right| \cdot \left|b\right|\\
t_2 := t\_0 - t\_1\\
t_3 := \frac{0.3333333333333333 \cdot c}{a}\\
\mathbf{if}\;\left|b\right| \leq 2.2 \cdot 10^{-131}:\\
\;\;\;\;\left(t\_3 \cdot t\_3\right) \cdot t\_3\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{81 \cdot \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(\left(t\_1 - t\_0\right) \cdot \left(\frac{-0.1111111111111111}{a \cdot a} \cdot t\_2\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.2e-131

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.2e-131 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.6%

      \[\leadsto \color{blue}{\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{81 \cdot \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(\frac{-0.1111111111111111}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 86.4% accurate, 2.4× speedup?

\[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ t_1 := \left(c \cdot a\right) \cdot 3 - t\_0\\ t_2 := \frac{0.3333333333333333 \cdot c}{a}\\ \mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\ \;\;\;\;\left(t\_2 \cdot t\_2\right) \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1 \cdot \left(t\_1 \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (fabs b) (fabs b)))
       (t_1 (- (* (* c a) 3.0) t_0))
       (t_2 (/ (* 0.3333333333333333 c) a)))
  (if (<= (fabs b) 4.5e-153)
    (* (* t_2 t_2) t_2)
    (*
     (/
      (* t_1 (* t_1 (/ 0.012345679012345678 (* (* a a) (* a a)))))
      (* a a))
     (- (* (* c a) 0.3333333333333333) (* t_0 0.1111111111111111))))))
double code(double a, double b, double c) {
	double t_0 = fabs(b) * fabs(b);
	double t_1 = ((c * a) * 3.0) - t_0;
	double t_2 = (0.3333333333333333 * c) / a;
	double tmp;
	if (fabs(b) <= 4.5e-153) {
		tmp = (t_2 * t_2) * t_2;
	} else {
		tmp = ((t_1 * (t_1 * (0.012345679012345678 / ((a * a) * (a * a))))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = abs(b) * abs(b)
    t_1 = ((c * a) * 3.0d0) - t_0
    t_2 = (0.3333333333333333d0 * c) / a
    if (abs(b) <= 4.5d-153) then
        tmp = (t_2 * t_2) * t_2
    else
        tmp = ((t_1 * (t_1 * (0.012345679012345678d0 / ((a * a) * (a * a))))) / (a * a)) * (((c * a) * 0.3333333333333333d0) - (t_0 * 0.1111111111111111d0))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.abs(b) * Math.abs(b);
	double t_1 = ((c * a) * 3.0) - t_0;
	double t_2 = (0.3333333333333333 * c) / a;
	double tmp;
	if (Math.abs(b) <= 4.5e-153) {
		tmp = (t_2 * t_2) * t_2;
	} else {
		tmp = ((t_1 * (t_1 * (0.012345679012345678 / ((a * a) * (a * a))))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.fabs(b) * math.fabs(b)
	t_1 = ((c * a) * 3.0) - t_0
	t_2 = (0.3333333333333333 * c) / a
	tmp = 0
	if math.fabs(b) <= 4.5e-153:
		tmp = (t_2 * t_2) * t_2
	else:
		tmp = ((t_1 * (t_1 * (0.012345679012345678 / ((a * a) * (a * a))))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111))
	return tmp
function code(a, b, c)
	t_0 = Float64(abs(b) * abs(b))
	t_1 = Float64(Float64(Float64(c * a) * 3.0) - t_0)
	t_2 = Float64(Float64(0.3333333333333333 * c) / a)
	tmp = 0.0
	if (abs(b) <= 4.5e-153)
		tmp = Float64(Float64(t_2 * t_2) * t_2);
	else
		tmp = Float64(Float64(Float64(t_1 * Float64(t_1 * Float64(0.012345679012345678 / Float64(Float64(a * a) * Float64(a * a))))) / Float64(a * a)) * Float64(Float64(Float64(c * a) * 0.3333333333333333) - Float64(t_0 * 0.1111111111111111)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = abs(b) * abs(b);
	t_1 = ((c * a) * 3.0) - t_0;
	t_2 = (0.3333333333333333 * c) / a;
	tmp = 0.0;
	if (abs(b) <= 4.5e-153)
		tmp = (t_2 * t_2) * t_2;
	else
		tmp = ((t_1 * (t_1 * (0.012345679012345678 / ((a * a) * (a * a))))) / (a * a)) * (((c * a) * 0.3333333333333333) - (t_0 * 0.1111111111111111));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 4.5e-153], N[(N[(t$95$2 * t$95$2), $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(N[(t$95$1 * N[(t$95$1 * N[(0.012345679012345678 / N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c * a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - N[(t$95$0 * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|b\right| \cdot \left|b\right|\\
t_1 := \left(c \cdot a\right) \cdot 3 - t\_0\\
t_2 := \frac{0.3333333333333333 \cdot c}{a}\\
\mathbf{if}\;\left|b\right| \leq 4.5 \cdot 10^{-153}:\\
\;\;\;\;\left(t\_2 \cdot t\_2\right) \cdot t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot \left(t\_1 \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - t\_0 \cdot 0.1111111111111111\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.5e-153

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 4.5e-153 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.2%

      \[\leadsto \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 84.8% accurate, 2.5× speedup?

\[\begin{array}{l} t_0 := \left(c \cdot 3\right) \cdot a - \left|b\right| \cdot \left|b\right|\\ t_1 := \frac{0.3333333333333333 \cdot c}{a}\\ \mathbf{if}\;\left|b\right| \leq 2.2 \cdot 10^{-131}:\\ \;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 \cdot \frac{0.012345679012345678 \cdot t\_0}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot a\right) \cdot a}\right) \cdot \left(0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(\frac{\left|b\right|}{a} \cdot \left|b\right|\right)\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (- (* (* c 3.0) a) (* (fabs b) (fabs b))))
       (t_1 (/ (* 0.3333333333333333 c) a)))
  (if (<= (fabs b) 2.2e-131)
    (* (* t_1 t_1) t_1)
    (*
     (*
      t_0
      (/ (* 0.012345679012345678 t_0) (* (* (* (* a a) a) a) a)))
     (-
      (* 0.3333333333333333 c)
      (* 0.1111111111111111 (* (/ (fabs b) a) (fabs b))))))))
double code(double a, double b, double c) {
	double t_0 = ((c * 3.0) * a) - (fabs(b) * fabs(b));
	double t_1 = (0.3333333333333333 * c) / a;
	double tmp;
	if (fabs(b) <= 2.2e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = (t_0 * ((0.012345679012345678 * t_0) / ((((a * a) * a) * a) * a))) * ((0.3333333333333333 * c) - (0.1111111111111111 * ((fabs(b) / a) * fabs(b))));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((c * 3.0d0) * a) - (abs(b) * abs(b))
    t_1 = (0.3333333333333333d0 * c) / a
    if (abs(b) <= 2.2d-131) then
        tmp = (t_1 * t_1) * t_1
    else
        tmp = (t_0 * ((0.012345679012345678d0 * t_0) / ((((a * a) * a) * a) * a))) * ((0.3333333333333333d0 * c) - (0.1111111111111111d0 * ((abs(b) / a) * abs(b))))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = ((c * 3.0) * a) - (Math.abs(b) * Math.abs(b));
	double t_1 = (0.3333333333333333 * c) / a;
	double tmp;
	if (Math.abs(b) <= 2.2e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = (t_0 * ((0.012345679012345678 * t_0) / ((((a * a) * a) * a) * a))) * ((0.3333333333333333 * c) - (0.1111111111111111 * ((Math.abs(b) / a) * Math.abs(b))));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = ((c * 3.0) * a) - (math.fabs(b) * math.fabs(b))
	t_1 = (0.3333333333333333 * c) / a
	tmp = 0
	if math.fabs(b) <= 2.2e-131:
		tmp = (t_1 * t_1) * t_1
	else:
		tmp = (t_0 * ((0.012345679012345678 * t_0) / ((((a * a) * a) * a) * a))) * ((0.3333333333333333 * c) - (0.1111111111111111 * ((math.fabs(b) / a) * math.fabs(b))))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(Float64(c * 3.0) * a) - Float64(abs(b) * abs(b)))
	t_1 = Float64(Float64(0.3333333333333333 * c) / a)
	tmp = 0.0
	if (abs(b) <= 2.2e-131)
		tmp = Float64(Float64(t_1 * t_1) * t_1);
	else
		tmp = Float64(Float64(t_0 * Float64(Float64(0.012345679012345678 * t_0) / Float64(Float64(Float64(Float64(a * a) * a) * a) * a))) * Float64(Float64(0.3333333333333333 * c) - Float64(0.1111111111111111 * Float64(Float64(abs(b) / a) * abs(b)))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = ((c * 3.0) * a) - (abs(b) * abs(b));
	t_1 = (0.3333333333333333 * c) / a;
	tmp = 0.0;
	if (abs(b) <= 2.2e-131)
		tmp = (t_1 * t_1) * t_1;
	else
		tmp = (t_0 * ((0.012345679012345678 * t_0) / ((((a * a) * a) * a) * a))) * ((0.3333333333333333 * c) - (0.1111111111111111 * ((abs(b) / a) * abs(b))));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[(c * 3.0), $MachinePrecision] * a), $MachinePrecision] - N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.2e-131], N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(t$95$0 * N[(N[(0.012345679012345678 * t$95$0), $MachinePrecision] / N[(N[(N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.3333333333333333 * c), $MachinePrecision] - N[(0.1111111111111111 * N[(N[(N[Abs[b], $MachinePrecision] / a), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(c \cdot 3\right) \cdot a - \left|b\right| \cdot \left|b\right|\\
t_1 := \frac{0.3333333333333333 \cdot c}{a}\\
\mathbf{if}\;\left|b\right| \leq 2.2 \cdot 10^{-131}:\\
\;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \frac{0.012345679012345678 \cdot t\_0}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot a\right) \cdot a}\right) \cdot \left(0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(\frac{\left|b\right|}{a} \cdot \left|b\right|\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.2e-131

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.2e-131 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.2%

      \[\leadsto \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)} \]
    3. Applied rewrites62.6%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot 3\right) \cdot a - b \cdot b\right) \cdot \frac{0.012345679012345678 \cdot \left(\left(c \cdot 3\right) \cdot a - b \cdot b\right)}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot a\right) \cdot a}\right) \cdot \left(0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 84.3% accurate, 2.4× speedup?

\[\begin{array}{l} t_0 := \left(a \cdot a\right) \cdot a\\ t_1 := \frac{0.3333333333333333 \cdot c}{a}\\ t_2 := \left|b\right| \cdot \left|b\right|\\ t_3 := \left(c \cdot 3\right) \cdot a - t\_2\\ t_4 := \left(c \cdot a\right) \cdot 3\\ t_5 := t\_2 - t\_4\\ \mathbf{if}\;\left|b\right| \leq 2.6 \cdot 10^{-131}:\\ \;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\ \mathbf{elif}\;\left|b\right| \leq 1.25 \cdot 10^{-81}:\\ \;\;\;\;\left(\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot t\_2\right) \cdot \left(\frac{0.012345679012345678 \cdot t\_3}{\left(t\_0 \cdot a\right) \cdot \left(a \cdot a\right)} \cdot t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_5 \cdot t\_5\right) \cdot \left(\frac{t\_4 - t\_2}{t\_0} \cdot \frac{0.0013717421124828531}{t\_0}\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (* a a) a))
       (t_1 (/ (* 0.3333333333333333 c) a))
       (t_2 (* (fabs b) (fabs b)))
       (t_3 (- (* (* c 3.0) a) t_2))
       (t_4 (* (* c a) 3.0))
       (t_5 (- t_2 t_4)))
  (if (<= (fabs b) 2.6e-131)
    (* (* t_1 t_1) t_1)
    (if (<= (fabs b) 1.25e-81)
      (*
       (- (* (* c a) 0.3333333333333333) (* 0.1111111111111111 t_2))
       (* (/ (* 0.012345679012345678 t_3) (* (* t_0 a) (* a a))) t_3))
      (*
       (* t_5 t_5)
       (* (/ (- t_4 t_2) t_0) (/ 0.0013717421124828531 t_0)))))))
double code(double a, double b, double c) {
	double t_0 = (a * a) * a;
	double t_1 = (0.3333333333333333 * c) / a;
	double t_2 = fabs(b) * fabs(b);
	double t_3 = ((c * 3.0) * a) - t_2;
	double t_4 = (c * a) * 3.0;
	double t_5 = t_2 - t_4;
	double tmp;
	if (fabs(b) <= 2.6e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else if (fabs(b) <= 1.25e-81) {
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_2)) * (((0.012345679012345678 * t_3) / ((t_0 * a) * (a * a))) * t_3);
	} else {
		tmp = (t_5 * t_5) * (((t_4 - t_2) / t_0) * (0.0013717421124828531 / t_0));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: tmp
    t_0 = (a * a) * a
    t_1 = (0.3333333333333333d0 * c) / a
    t_2 = abs(b) * abs(b)
    t_3 = ((c * 3.0d0) * a) - t_2
    t_4 = (c * a) * 3.0d0
    t_5 = t_2 - t_4
    if (abs(b) <= 2.6d-131) then
        tmp = (t_1 * t_1) * t_1
    else if (abs(b) <= 1.25d-81) then
        tmp = (((c * a) * 0.3333333333333333d0) - (0.1111111111111111d0 * t_2)) * (((0.012345679012345678d0 * t_3) / ((t_0 * a) * (a * a))) * t_3)
    else
        tmp = (t_5 * t_5) * (((t_4 - t_2) / t_0) * (0.0013717421124828531d0 / t_0))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (a * a) * a;
	double t_1 = (0.3333333333333333 * c) / a;
	double t_2 = Math.abs(b) * Math.abs(b);
	double t_3 = ((c * 3.0) * a) - t_2;
	double t_4 = (c * a) * 3.0;
	double t_5 = t_2 - t_4;
	double tmp;
	if (Math.abs(b) <= 2.6e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else if (Math.abs(b) <= 1.25e-81) {
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_2)) * (((0.012345679012345678 * t_3) / ((t_0 * a) * (a * a))) * t_3);
	} else {
		tmp = (t_5 * t_5) * (((t_4 - t_2) / t_0) * (0.0013717421124828531 / t_0));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (a * a) * a
	t_1 = (0.3333333333333333 * c) / a
	t_2 = math.fabs(b) * math.fabs(b)
	t_3 = ((c * 3.0) * a) - t_2
	t_4 = (c * a) * 3.0
	t_5 = t_2 - t_4
	tmp = 0
	if math.fabs(b) <= 2.6e-131:
		tmp = (t_1 * t_1) * t_1
	elif math.fabs(b) <= 1.25e-81:
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_2)) * (((0.012345679012345678 * t_3) / ((t_0 * a) * (a * a))) * t_3)
	else:
		tmp = (t_5 * t_5) * (((t_4 - t_2) / t_0) * (0.0013717421124828531 / t_0))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(a * a) * a)
	t_1 = Float64(Float64(0.3333333333333333 * c) / a)
	t_2 = Float64(abs(b) * abs(b))
	t_3 = Float64(Float64(Float64(c * 3.0) * a) - t_2)
	t_4 = Float64(Float64(c * a) * 3.0)
	t_5 = Float64(t_2 - t_4)
	tmp = 0.0
	if (abs(b) <= 2.6e-131)
		tmp = Float64(Float64(t_1 * t_1) * t_1);
	elseif (abs(b) <= 1.25e-81)
		tmp = Float64(Float64(Float64(Float64(c * a) * 0.3333333333333333) - Float64(0.1111111111111111 * t_2)) * Float64(Float64(Float64(0.012345679012345678 * t_3) / Float64(Float64(t_0 * a) * Float64(a * a))) * t_3));
	else
		tmp = Float64(Float64(t_5 * t_5) * Float64(Float64(Float64(t_4 - t_2) / t_0) * Float64(0.0013717421124828531 / t_0)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (a * a) * a;
	t_1 = (0.3333333333333333 * c) / a;
	t_2 = abs(b) * abs(b);
	t_3 = ((c * 3.0) * a) - t_2;
	t_4 = (c * a) * 3.0;
	t_5 = t_2 - t_4;
	tmp = 0.0;
	if (abs(b) <= 2.6e-131)
		tmp = (t_1 * t_1) * t_1;
	elseif (abs(b) <= 1.25e-81)
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_2)) * (((0.012345679012345678 * t_3) / ((t_0 * a) * (a * a))) * t_3);
	else
		tmp = (t_5 * t_5) * (((t_4 - t_2) / t_0) * (0.0013717421124828531 / t_0));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(c * 3.0), $MachinePrecision] * a), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 - t$95$4), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.6e-131], N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Abs[b], $MachinePrecision], 1.25e-81], N[(N[(N[(N[(c * a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - N[(0.1111111111111111 * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(0.012345679012345678 * t$95$3), $MachinePrecision] / N[(N[(t$95$0 * a), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$5 * t$95$5), $MachinePrecision] * N[(N[(N[(t$95$4 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(0.0013717421124828531 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_0 := \left(a \cdot a\right) \cdot a\\
t_1 := \frac{0.3333333333333333 \cdot c}{a}\\
t_2 := \left|b\right| \cdot \left|b\right|\\
t_3 := \left(c \cdot 3\right) \cdot a - t\_2\\
t_4 := \left(c \cdot a\right) \cdot 3\\
t_5 := t\_2 - t\_4\\
\mathbf{if}\;\left|b\right| \leq 2.6 \cdot 10^{-131}:\\
\;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\

\mathbf{elif}\;\left|b\right| \leq 1.25 \cdot 10^{-81}:\\
\;\;\;\;\left(\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot t\_2\right) \cdot \left(\frac{0.012345679012345678 \cdot t\_3}{\left(t\_0 \cdot a\right) \cdot \left(a \cdot a\right)} \cdot t\_3\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_5 \cdot t\_5\right) \cdot \left(\frac{t\_4 - t\_2}{t\_0} \cdot \frac{0.0013717421124828531}{t\_0}\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.6e-131

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.6e-131 < b < 1.25e-81

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.2%

      \[\leadsto \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)} \]
    3. Applied rewrites59.3%

      \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot \left(b \cdot b\right)\right) \cdot \left(\frac{0.012345679012345678 \cdot \left(\left(c \cdot 3\right) \cdot a - b \cdot b\right)}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot a\right) \cdot \left(a \cdot a\right)} \cdot \left(\left(c \cdot 3\right) \cdot a - b \cdot b\right)\right)} \]

    if 1.25e-81 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}}^{3} \]
      3. mult-flipN/A

        \[\leadsto {\color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \frac{1}{9 \cdot {a}^{2}}\right)}}^{3} \]
      4. cube-prodN/A

        \[\leadsto \color{blue}{{\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}^{3} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}} \]
      5. unpow3N/A

        \[\leadsto \color{blue}{\left(\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right)} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
    3. Applied rewrites40.3%

      \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}}\right) \]
      3. associate-*r/N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot a\right)} \cdot \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\left(a \cdot a\right) \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)}} \]
      8. unswap-sqrN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot \left(a \cdot a\right)\right)}} \]
      9. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot \left(a \cdot a\right)\right)} \cdot \left(a \cdot \left(a \cdot a\right)\right)} \]
      10. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\left(a \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(a \cdot \left(a \cdot a\right)\right)}} \]
      11. times-fracN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a \cdot \left(a \cdot a\right)} \cdot \frac{\frac{1}{729}}{a \cdot \left(a \cdot a\right)}\right)} \]
      12. metadata-evalN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a \cdot \left(a \cdot a\right)} \cdot \frac{\color{blue}{{\frac{1}{9}}^{3}}}{a \cdot \left(a \cdot a\right)}\right) \]
      13. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a \cdot \left(a \cdot a\right)} \cdot \frac{{\frac{1}{9}}^{3}}{\color{blue}{a \cdot \left(a \cdot a\right)}}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a \cdot \left(a \cdot a\right)} \cdot \frac{{\frac{1}{9}}^{3}}{a \cdot \color{blue}{\left(a \cdot a\right)}}\right) \]
      15. cube-unmultN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a \cdot \left(a \cdot a\right)} \cdot \frac{{\frac{1}{9}}^{3}}{\color{blue}{{a}^{3}}}\right) \]
      16. cube-divN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a \cdot \left(a \cdot a\right)} \cdot \color{blue}{{\left(\frac{\frac{1}{9}}{a}\right)}^{3}}\right) \]
      17. lift-/.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{a \cdot \left(a \cdot a\right)} \cdot {\color{blue}{\left(\frac{\frac{1}{9}}{a}\right)}}^{3}\right) \]
    5. Applied rewrites46.5%

      \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\left(\frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{\left(a \cdot a\right) \cdot a} \cdot \frac{0.0013717421124828531}{\left(a \cdot a\right) \cdot a}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 83.3% accurate, 2.5× speedup?

\[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ t_1 := \frac{0.3333333333333333 \cdot c}{a}\\ t_2 := \left(c \cdot 3\right) \cdot a - t\_0\\ \mathbf{if}\;\left|b\right| \leq 2.6 \cdot 10^{-131}:\\ \;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot t\_0\right) \cdot \left(\frac{0.012345679012345678 \cdot t\_2}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot a\right) \cdot \left(a \cdot a\right)} \cdot t\_2\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (fabs b) (fabs b)))
       (t_1 (/ (* 0.3333333333333333 c) a))
       (t_2 (- (* (* c 3.0) a) t_0)))
  (if (<= (fabs b) 2.6e-131)
    (* (* t_1 t_1) t_1)
    (*
     (- (* (* c a) 0.3333333333333333) (* 0.1111111111111111 t_0))
     (*
      (/ (* 0.012345679012345678 t_2) (* (* (* (* a a) a) a) (* a a)))
      t_2)))))
double code(double a, double b, double c) {
	double t_0 = fabs(b) * fabs(b);
	double t_1 = (0.3333333333333333 * c) / a;
	double t_2 = ((c * 3.0) * a) - t_0;
	double tmp;
	if (fabs(b) <= 2.6e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_0)) * (((0.012345679012345678 * t_2) / ((((a * a) * a) * a) * (a * a))) * t_2);
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = abs(b) * abs(b)
    t_1 = (0.3333333333333333d0 * c) / a
    t_2 = ((c * 3.0d0) * a) - t_0
    if (abs(b) <= 2.6d-131) then
        tmp = (t_1 * t_1) * t_1
    else
        tmp = (((c * a) * 0.3333333333333333d0) - (0.1111111111111111d0 * t_0)) * (((0.012345679012345678d0 * t_2) / ((((a * a) * a) * a) * (a * a))) * t_2)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.abs(b) * Math.abs(b);
	double t_1 = (0.3333333333333333 * c) / a;
	double t_2 = ((c * 3.0) * a) - t_0;
	double tmp;
	if (Math.abs(b) <= 2.6e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_0)) * (((0.012345679012345678 * t_2) / ((((a * a) * a) * a) * (a * a))) * t_2);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.fabs(b) * math.fabs(b)
	t_1 = (0.3333333333333333 * c) / a
	t_2 = ((c * 3.0) * a) - t_0
	tmp = 0
	if math.fabs(b) <= 2.6e-131:
		tmp = (t_1 * t_1) * t_1
	else:
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_0)) * (((0.012345679012345678 * t_2) / ((((a * a) * a) * a) * (a * a))) * t_2)
	return tmp
function code(a, b, c)
	t_0 = Float64(abs(b) * abs(b))
	t_1 = Float64(Float64(0.3333333333333333 * c) / a)
	t_2 = Float64(Float64(Float64(c * 3.0) * a) - t_0)
	tmp = 0.0
	if (abs(b) <= 2.6e-131)
		tmp = Float64(Float64(t_1 * t_1) * t_1);
	else
		tmp = Float64(Float64(Float64(Float64(c * a) * 0.3333333333333333) - Float64(0.1111111111111111 * t_0)) * Float64(Float64(Float64(0.012345679012345678 * t_2) / Float64(Float64(Float64(Float64(a * a) * a) * a) * Float64(a * a))) * t_2));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = abs(b) * abs(b);
	t_1 = (0.3333333333333333 * c) / a;
	t_2 = ((c * 3.0) * a) - t_0;
	tmp = 0.0;
	if (abs(b) <= 2.6e-131)
		tmp = (t_1 * t_1) * t_1;
	else
		tmp = (((c * a) * 0.3333333333333333) - (0.1111111111111111 * t_0)) * (((0.012345679012345678 * t_2) / ((((a * a) * a) * a) * (a * a))) * t_2);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(c * 3.0), $MachinePrecision] * a), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.6e-131], N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(N[(c * a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - N[(0.1111111111111111 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(0.012345679012345678 * t$95$2), $MachinePrecision] / N[(N[(N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|b\right| \cdot \left|b\right|\\
t_1 := \frac{0.3333333333333333 \cdot c}{a}\\
t_2 := \left(c \cdot 3\right) \cdot a - t\_0\\
\mathbf{if}\;\left|b\right| \leq 2.6 \cdot 10^{-131}:\\
\;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot t\_0\right) \cdot \left(\frac{0.012345679012345678 \cdot t\_2}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot a\right) \cdot \left(a \cdot a\right)} \cdot t\_2\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.6e-131

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.6e-131 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.2%

      \[\leadsto \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.012345679012345678}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)}\right)}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)} \]
    3. Applied rewrites59.3%

      \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 0.3333333333333333 - 0.1111111111111111 \cdot \left(b \cdot b\right)\right) \cdot \left(\frac{0.012345679012345678 \cdot \left(\left(c \cdot 3\right) \cdot a - b \cdot b\right)}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot a\right) \cdot \left(a \cdot a\right)} \cdot \left(\left(c \cdot 3\right) \cdot a - b \cdot b\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 83.2% accurate, 2.6× speedup?

\[\begin{array}{l} t_0 := \left(c \cdot a\right) \cdot 3 - \left|b\right| \cdot \left|b\right|\\ t_1 := \frac{0.3333333333333333 \cdot c}{a}\\ t_2 := \left(a \cdot a\right) \cdot a\\ \mathbf{if}\;\left|b\right| \leq 2.6 \cdot 10^{-131}:\\ \;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(t\_0 \cdot \left(\frac{0.0013717421124828531}{t\_2 \cdot t\_2} \cdot t\_0\right)\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (- (* (* c a) 3.0) (* (fabs b) (fabs b))))
       (t_1 (/ (* 0.3333333333333333 c) a))
       (t_2 (* (* a a) a)))
  (if (<= (fabs b) 2.6e-131)
    (* (* t_1 t_1) t_1)
    (* t_0 (* t_0 (* (/ 0.0013717421124828531 (* t_2 t_2)) t_0))))))
double code(double a, double b, double c) {
	double t_0 = ((c * a) * 3.0) - (fabs(b) * fabs(b));
	double t_1 = (0.3333333333333333 * c) / a;
	double t_2 = (a * a) * a;
	double tmp;
	if (fabs(b) <= 2.6e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = t_0 * (t_0 * ((0.0013717421124828531 / (t_2 * t_2)) * t_0));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = ((c * a) * 3.0d0) - (abs(b) * abs(b))
    t_1 = (0.3333333333333333d0 * c) / a
    t_2 = (a * a) * a
    if (abs(b) <= 2.6d-131) then
        tmp = (t_1 * t_1) * t_1
    else
        tmp = t_0 * (t_0 * ((0.0013717421124828531d0 / (t_2 * t_2)) * t_0))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = ((c * a) * 3.0) - (Math.abs(b) * Math.abs(b));
	double t_1 = (0.3333333333333333 * c) / a;
	double t_2 = (a * a) * a;
	double tmp;
	if (Math.abs(b) <= 2.6e-131) {
		tmp = (t_1 * t_1) * t_1;
	} else {
		tmp = t_0 * (t_0 * ((0.0013717421124828531 / (t_2 * t_2)) * t_0));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = ((c * a) * 3.0) - (math.fabs(b) * math.fabs(b))
	t_1 = (0.3333333333333333 * c) / a
	t_2 = (a * a) * a
	tmp = 0
	if math.fabs(b) <= 2.6e-131:
		tmp = (t_1 * t_1) * t_1
	else:
		tmp = t_0 * (t_0 * ((0.0013717421124828531 / (t_2 * t_2)) * t_0))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(Float64(c * a) * 3.0) - Float64(abs(b) * abs(b)))
	t_1 = Float64(Float64(0.3333333333333333 * c) / a)
	t_2 = Float64(Float64(a * a) * a)
	tmp = 0.0
	if (abs(b) <= 2.6e-131)
		tmp = Float64(Float64(t_1 * t_1) * t_1);
	else
		tmp = Float64(t_0 * Float64(t_0 * Float64(Float64(0.0013717421124828531 / Float64(t_2 * t_2)) * t_0)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = ((c * a) * 3.0) - (abs(b) * abs(b));
	t_1 = (0.3333333333333333 * c) / a;
	t_2 = (a * a) * a;
	tmp = 0.0;
	if (abs(b) <= 2.6e-131)
		tmp = (t_1 * t_1) * t_1;
	else
		tmp = t_0 * (t_0 * ((0.0013717421124828531 / (t_2 * t_2)) * t_0));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision] - N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.6e-131], N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$0 * N[(t$95$0 * N[(N[(0.0013717421124828531 / N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(c \cdot a\right) \cdot 3 - \left|b\right| \cdot \left|b\right|\\
t_1 := \frac{0.3333333333333333 \cdot c}{a}\\
t_2 := \left(a \cdot a\right) \cdot a\\
\mathbf{if}\;\left|b\right| \leq 2.6 \cdot 10^{-131}:\\
\;\;\;\;\left(t\_1 \cdot t\_1\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_0 \cdot \left(\frac{0.0013717421124828531}{t\_2 \cdot t\_2} \cdot t\_0\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.6e-131

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.6e-131 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}}^{3} \]
      3. mult-flipN/A

        \[\leadsto {\color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \frac{1}{9 \cdot {a}^{2}}\right)}}^{3} \]
      4. cube-prodN/A

        \[\leadsto \color{blue}{{\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}^{3} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}} \]
      5. unpow3N/A

        \[\leadsto \color{blue}{\left(\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right)} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
    3. Applied rewrites40.3%

      \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}}\right) \]
      3. associate-*r/N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot a\right)} \cdot \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\left(a \cdot a\right) \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)}} \]
      8. unswap-sqrN/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot \left(a \cdot a\right)\right)}} \]
      9. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\color{blue}{\left(a \cdot \left(a \cdot a\right)\right)} \cdot \left(a \cdot \left(a \cdot a\right)\right)} \]
      10. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{\left(a \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(a \cdot \left(a \cdot a\right)\right)}} \]
      11. associate-/r*N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\frac{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{a \cdot \left(a \cdot a\right)}}{a \cdot \left(a \cdot a\right)}} \]
      12. lower-/.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\frac{\frac{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{1}{729}}{a \cdot \left(a \cdot a\right)}}{a \cdot \left(a \cdot a\right)}} \]
    5. Applied rewrites46.8%

      \[\leadsto \left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \color{blue}{\frac{\frac{0.0013717421124828531 \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a}} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right)} \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      3. sqr-neg-revN/A

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right)\right)\right)} \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)}\right)\right) \cdot \left(\mathsf{neg}\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right)\right)\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      5. sub-negate-revN/A

        \[\leadsto \left(\color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)} \cdot \left(\mathsf{neg}\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right)\right)\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      6. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)} \cdot \left(\mathsf{neg}\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right)\right)\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)}\right)\right)\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      8. sub-negate-revN/A

        \[\leadsto \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      9. lift--.f64N/A

        \[\leadsto \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a} \]
      10. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{\frac{1}{729} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)}{\left(a \cdot a\right) \cdot a}}{\left(a \cdot a\right) \cdot a}\right)} \]
    7. Applied rewrites59.0%

      \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 80.4% accurate, 2.5× speedup?

\[\begin{array}{l} t_0 := \left(c \cdot a\right) \cdot 3\\ t_1 := \left|b\right| \cdot \left|b\right|\\ t_2 := t\_0 - t\_1\\ t_3 := \frac{0.3333333333333333 \cdot c}{a}\\ t_4 := t\_1 - t\_0\\ \mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\ \;\;\;\;\left(t\_3 \cdot t\_3\right) \cdot t\_3\\ \mathbf{elif}\;\left|b\right| \leq 2.45 \cdot 10^{-80}:\\ \;\;\;\;t\_2 \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{t\_4 \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_4 \cdot t\_4\right) \cdot \frac{t\_2}{729 \cdot \left(\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)\right)}\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (* c a) 3.0))
       (t_1 (* (fabs b) (fabs b)))
       (t_2 (- t_0 t_1))
       (t_3 (/ (* 0.3333333333333333 c) a))
       (t_4 (- t_1 t_0)))
  (if (<= (fabs b) 2.25e-138)
    (* (* t_3 t_3) t_3)
    (if (<= (fabs b) 2.45e-80)
      (*
       t_2
       (*
        (* -0.037037037037037035 (/ c a))
        (/ (* t_4 (/ 0.1111111111111111 (* a a))) (* a a))))
      (*
       (* t_4 t_4)
       (/ t_2 (* 729.0 (* (* (* a a) (* a a)) (* a a)))))))))
double code(double a, double b, double c) {
	double t_0 = (c * a) * 3.0;
	double t_1 = fabs(b) * fabs(b);
	double t_2 = t_0 - t_1;
	double t_3 = (0.3333333333333333 * c) / a;
	double t_4 = t_1 - t_0;
	double tmp;
	if (fabs(b) <= 2.25e-138) {
		tmp = (t_3 * t_3) * t_3;
	} else if (fabs(b) <= 2.45e-80) {
		tmp = t_2 * ((-0.037037037037037035 * (c / a)) * ((t_4 * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = (t_4 * t_4) * (t_2 / (729.0 * (((a * a) * (a * a)) * (a * a))));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = (c * a) * 3.0d0
    t_1 = abs(b) * abs(b)
    t_2 = t_0 - t_1
    t_3 = (0.3333333333333333d0 * c) / a
    t_4 = t_1 - t_0
    if (abs(b) <= 2.25d-138) then
        tmp = (t_3 * t_3) * t_3
    else if (abs(b) <= 2.45d-80) then
        tmp = t_2 * (((-0.037037037037037035d0) * (c / a)) * ((t_4 * (0.1111111111111111d0 / (a * a))) / (a * a)))
    else
        tmp = (t_4 * t_4) * (t_2 / (729.0d0 * (((a * a) * (a * a)) * (a * a))))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * a) * 3.0;
	double t_1 = Math.abs(b) * Math.abs(b);
	double t_2 = t_0 - t_1;
	double t_3 = (0.3333333333333333 * c) / a;
	double t_4 = t_1 - t_0;
	double tmp;
	if (Math.abs(b) <= 2.25e-138) {
		tmp = (t_3 * t_3) * t_3;
	} else if (Math.abs(b) <= 2.45e-80) {
		tmp = t_2 * ((-0.037037037037037035 * (c / a)) * ((t_4 * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = (t_4 * t_4) * (t_2 / (729.0 * (((a * a) * (a * a)) * (a * a))));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * a) * 3.0
	t_1 = math.fabs(b) * math.fabs(b)
	t_2 = t_0 - t_1
	t_3 = (0.3333333333333333 * c) / a
	t_4 = t_1 - t_0
	tmp = 0
	if math.fabs(b) <= 2.25e-138:
		tmp = (t_3 * t_3) * t_3
	elif math.fabs(b) <= 2.45e-80:
		tmp = t_2 * ((-0.037037037037037035 * (c / a)) * ((t_4 * (0.1111111111111111 / (a * a))) / (a * a)))
	else:
		tmp = (t_4 * t_4) * (t_2 / (729.0 * (((a * a) * (a * a)) * (a * a))))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * a) * 3.0)
	t_1 = Float64(abs(b) * abs(b))
	t_2 = Float64(t_0 - t_1)
	t_3 = Float64(Float64(0.3333333333333333 * c) / a)
	t_4 = Float64(t_1 - t_0)
	tmp = 0.0
	if (abs(b) <= 2.25e-138)
		tmp = Float64(Float64(t_3 * t_3) * t_3);
	elseif (abs(b) <= 2.45e-80)
		tmp = Float64(t_2 * Float64(Float64(-0.037037037037037035 * Float64(c / a)) * Float64(Float64(t_4 * Float64(0.1111111111111111 / Float64(a * a))) / Float64(a * a))));
	else
		tmp = Float64(Float64(t_4 * t_4) * Float64(t_2 / Float64(729.0 * Float64(Float64(Float64(a * a) * Float64(a * a)) * Float64(a * a)))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * a) * 3.0;
	t_1 = abs(b) * abs(b);
	t_2 = t_0 - t_1;
	t_3 = (0.3333333333333333 * c) / a;
	t_4 = t_1 - t_0;
	tmp = 0.0;
	if (abs(b) <= 2.25e-138)
		tmp = (t_3 * t_3) * t_3;
	elseif (abs(b) <= 2.45e-80)
		tmp = t_2 * ((-0.037037037037037035 * (c / a)) * ((t_4 * (0.1111111111111111 / (a * a))) / (a * a)));
	else
		tmp = (t_4 * t_4) * (t_2 / (729.0 * (((a * a) * (a * a)) * (a * a))));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 - t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.25e-138], N[(N[(t$95$3 * t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[N[Abs[b], $MachinePrecision], 2.45e-80], N[(t$95$2 * N[(N[(-0.037037037037037035 * N[(c / a), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$4 * N[(0.1111111111111111 / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 * t$95$4), $MachinePrecision] * N[(t$95$2 / N[(729.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \left(c \cdot a\right) \cdot 3\\
t_1 := \left|b\right| \cdot \left|b\right|\\
t_2 := t\_0 - t\_1\\
t_3 := \frac{0.3333333333333333 \cdot c}{a}\\
t_4 := t\_1 - t\_0\\
\mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\
\;\;\;\;\left(t\_3 \cdot t\_3\right) \cdot t\_3\\

\mathbf{elif}\;\left|b\right| \leq 2.45 \cdot 10^{-80}:\\
\;\;\;\;t\_2 \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{t\_4 \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_4 \cdot t\_4\right) \cdot \frac{t\_2}{729 \cdot \left(\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)\right)}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.25e-138

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.25e-138 < b < 2.45e-80

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.6%

      \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\frac{0.1111111111111111 \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)} \cdot \left(\frac{0.1111111111111111}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right)\right)} \]
    3. Applied rewrites76.0%

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)} \]
    4. Taylor expanded in a around inf

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\color{blue}{\left(\frac{-1}{27} \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\frac{-1}{27} \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      2. lower-/.f6452.6%

        \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{\color{blue}{a}}\right) \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    6. Applied rewrites52.6%

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\color{blue}{\left(-0.037037037037037035 \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]

    if 2.45e-80 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}}^{3} \]
      3. cube-divN/A

        \[\leadsto \color{blue}{\frac{{\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}^{3}}{{\left(9 \cdot {a}^{2}\right)}^{3}}} \]
      4. unpow3N/A

        \[\leadsto \frac{\color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}}{{\left(9 \cdot {a}^{2}\right)}^{3}} \]
      5. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{{\left(9 \cdot {a}^{2}\right)}^{3}}} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{{\left(9 \cdot {a}^{2}\right)}^{3}}} \]
    3. Applied rewrites40.7%

      \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \frac{\left(c \cdot a\right) \cdot 3 - b \cdot b}{729 \cdot \left(\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 80.3% accurate, 2.5× speedup?

\[\begin{array}{l} t_0 := \left(3 \cdot c\right) \cdot a\\ t_1 := \left|b\right| \cdot \left|b\right|\\ t_2 := \frac{0.3333333333333333 \cdot c}{a}\\ t_3 := \left(c \cdot a\right) \cdot 3\\ t_4 := t\_1 - t\_0\\ \mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\ \;\;\;\;\left(t\_2 \cdot t\_2\right) \cdot t\_2\\ \mathbf{elif}\;\left|b\right| \leq 2.45 \cdot 10^{-80}:\\ \;\;\;\;\left(t\_3 - t\_1\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{\left(t\_1 - t\_3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_4 \cdot t\_4\right) \cdot \left(\left(t\_0 - t\_1\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (* 3.0 c) a))
       (t_1 (* (fabs b) (fabs b)))
       (t_2 (/ (* 0.3333333333333333 c) a))
       (t_3 (* (* c a) 3.0))
       (t_4 (- t_1 t_0)))
  (if (<= (fabs b) 2.25e-138)
    (* (* t_2 t_2) t_2)
    (if (<= (fabs b) 2.45e-80)
      (*
       (- t_3 t_1)
       (*
        (* -0.037037037037037035 (/ c a))
        (/ (* (- t_1 t_3) (/ 0.1111111111111111 (* a a))) (* a a))))
      (*
       (* t_4 t_4)
       (*
        (- t_0 t_1)
        (/ 0.0013717421124828531 (* (* (* a a) (* a a)) (* a a)))))))))
double code(double a, double b, double c) {
	double t_0 = (3.0 * c) * a;
	double t_1 = fabs(b) * fabs(b);
	double t_2 = (0.3333333333333333 * c) / a;
	double t_3 = (c * a) * 3.0;
	double t_4 = t_1 - t_0;
	double tmp;
	if (fabs(b) <= 2.25e-138) {
		tmp = (t_2 * t_2) * t_2;
	} else if (fabs(b) <= 2.45e-80) {
		tmp = (t_3 - t_1) * ((-0.037037037037037035 * (c / a)) * (((t_1 - t_3) * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = (t_4 * t_4) * ((t_0 - t_1) * (0.0013717421124828531 / (((a * a) * (a * a)) * (a * a))));
	}
	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(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = (3.0d0 * c) * a
    t_1 = abs(b) * abs(b)
    t_2 = (0.3333333333333333d0 * c) / a
    t_3 = (c * a) * 3.0d0
    t_4 = t_1 - t_0
    if (abs(b) <= 2.25d-138) then
        tmp = (t_2 * t_2) * t_2
    else if (abs(b) <= 2.45d-80) then
        tmp = (t_3 - t_1) * (((-0.037037037037037035d0) * (c / a)) * (((t_1 - t_3) * (0.1111111111111111d0 / (a * a))) / (a * a)))
    else
        tmp = (t_4 * t_4) * ((t_0 - t_1) * (0.0013717421124828531d0 / (((a * a) * (a * a)) * (a * a))))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (3.0 * c) * a;
	double t_1 = Math.abs(b) * Math.abs(b);
	double t_2 = (0.3333333333333333 * c) / a;
	double t_3 = (c * a) * 3.0;
	double t_4 = t_1 - t_0;
	double tmp;
	if (Math.abs(b) <= 2.25e-138) {
		tmp = (t_2 * t_2) * t_2;
	} else if (Math.abs(b) <= 2.45e-80) {
		tmp = (t_3 - t_1) * ((-0.037037037037037035 * (c / a)) * (((t_1 - t_3) * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = (t_4 * t_4) * ((t_0 - t_1) * (0.0013717421124828531 / (((a * a) * (a * a)) * (a * a))));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (3.0 * c) * a
	t_1 = math.fabs(b) * math.fabs(b)
	t_2 = (0.3333333333333333 * c) / a
	t_3 = (c * a) * 3.0
	t_4 = t_1 - t_0
	tmp = 0
	if math.fabs(b) <= 2.25e-138:
		tmp = (t_2 * t_2) * t_2
	elif math.fabs(b) <= 2.45e-80:
		tmp = (t_3 - t_1) * ((-0.037037037037037035 * (c / a)) * (((t_1 - t_3) * (0.1111111111111111 / (a * a))) / (a * a)))
	else:
		tmp = (t_4 * t_4) * ((t_0 - t_1) * (0.0013717421124828531 / (((a * a) * (a * a)) * (a * a))))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(3.0 * c) * a)
	t_1 = Float64(abs(b) * abs(b))
	t_2 = Float64(Float64(0.3333333333333333 * c) / a)
	t_3 = Float64(Float64(c * a) * 3.0)
	t_4 = Float64(t_1 - t_0)
	tmp = 0.0
	if (abs(b) <= 2.25e-138)
		tmp = Float64(Float64(t_2 * t_2) * t_2);
	elseif (abs(b) <= 2.45e-80)
		tmp = Float64(Float64(t_3 - t_1) * Float64(Float64(-0.037037037037037035 * Float64(c / a)) * Float64(Float64(Float64(t_1 - t_3) * Float64(0.1111111111111111 / Float64(a * a))) / Float64(a * a))));
	else
		tmp = Float64(Float64(t_4 * t_4) * Float64(Float64(t_0 - t_1) * Float64(0.0013717421124828531 / Float64(Float64(Float64(a * a) * Float64(a * a)) * Float64(a * a)))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (3.0 * c) * a;
	t_1 = abs(b) * abs(b);
	t_2 = (0.3333333333333333 * c) / a;
	t_3 = (c * a) * 3.0;
	t_4 = t_1 - t_0;
	tmp = 0.0;
	if (abs(b) <= 2.25e-138)
		tmp = (t_2 * t_2) * t_2;
	elseif (abs(b) <= 2.45e-80)
		tmp = (t_3 - t_1) * ((-0.037037037037037035 * (c / a)) * (((t_1 - t_3) * (0.1111111111111111 / (a * a))) / (a * a)));
	else
		tmp = (t_4 * t_4) * ((t_0 - t_1) * (0.0013717421124828531 / (((a * a) * (a * a)) * (a * a))));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(3.0 * c), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 - t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.25e-138], N[(N[(t$95$2 * t$95$2), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[N[Abs[b], $MachinePrecision], 2.45e-80], N[(N[(t$95$3 - t$95$1), $MachinePrecision] * N[(N[(-0.037037037037037035 * N[(c / a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$1 - t$95$3), $MachinePrecision] * N[(0.1111111111111111 / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 * t$95$4), $MachinePrecision] * N[(N[(t$95$0 - t$95$1), $MachinePrecision] * N[(0.0013717421124828531 / N[(N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot c\right) \cdot a\\
t_1 := \left|b\right| \cdot \left|b\right|\\
t_2 := \frac{0.3333333333333333 \cdot c}{a}\\
t_3 := \left(c \cdot a\right) \cdot 3\\
t_4 := t\_1 - t\_0\\
\mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\
\;\;\;\;\left(t\_2 \cdot t\_2\right) \cdot t\_2\\

\mathbf{elif}\;\left|b\right| \leq 2.45 \cdot 10^{-80}:\\
\;\;\;\;\left(t\_3 - t\_1\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{\left(t\_1 - t\_3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_4 \cdot t\_4\right) \cdot \left(\left(t\_0 - t\_1\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.25e-138

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.25e-138 < b < 2.45e-80

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.6%

      \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\frac{0.1111111111111111 \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)} \cdot \left(\frac{0.1111111111111111}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right)\right)} \]
    3. Applied rewrites76.0%

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)} \]
    4. Taylor expanded in a around inf

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\color{blue}{\left(\frac{-1}{27} \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\frac{-1}{27} \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      2. lower-/.f6452.6%

        \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{\color{blue}{a}}\right) \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    6. Applied rewrites52.6%

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\color{blue}{\left(-0.037037037037037035 \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]

    if 2.45e-80 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}}^{3} \]
      3. mult-flipN/A

        \[\leadsto {\color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \frac{1}{9 \cdot {a}^{2}}\right)}}^{3} \]
      4. cube-prodN/A

        \[\leadsto \color{blue}{{\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}^{3} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}} \]
      5. unpow3N/A

        \[\leadsto \color{blue}{\left(\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right)} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
    3. Applied rewrites40.3%

      \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{\left(c \cdot a\right) \cdot 3}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{3 \cdot \left(c \cdot a\right)}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - 3 \cdot \color{blue}{\left(c \cdot a\right)}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      6. lower-*.f6440.3%

        \[\leadsto \left(\left(b \cdot b - \color{blue}{\left(3 \cdot c\right)} \cdot a\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    5. Applied rewrites40.3%

      \[\leadsto \left(\left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \color{blue}{\left(c \cdot a\right) \cdot 3}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \color{blue}{3 \cdot \left(c \cdot a\right)}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - 3 \cdot \color{blue}{\left(c \cdot a\right)}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      6. lower-*.f6440.3%

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \color{blue}{\left(3 \cdot c\right)} \cdot a\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    7. Applied rewrites40.3%

      \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \left(3 \cdot c\right) \cdot a\right)\right) \cdot \left(\left(\color{blue}{\left(c \cdot a\right) \cdot 3} - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \left(3 \cdot c\right) \cdot a\right)\right) \cdot \left(\left(\color{blue}{3 \cdot \left(c \cdot a\right)} - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \left(3 \cdot c\right) \cdot a\right)\right) \cdot \left(\left(3 \cdot \color{blue}{\left(c \cdot a\right)} - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \left(3 \cdot c\right) \cdot a\right)\right) \cdot \left(\left(\color{blue}{\left(3 \cdot c\right) \cdot a} - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \left(3 \cdot c\right) \cdot a\right)\right) \cdot \left(\left(\color{blue}{\left(3 \cdot c\right) \cdot a} - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      6. lower-*.f6440.3%

        \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \left(3 \cdot c\right) \cdot a\right)\right) \cdot \left(\left(\color{blue}{\left(3 \cdot c\right)} \cdot a - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    9. Applied rewrites40.3%

      \[\leadsto \left(\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \left(b \cdot b - \left(3 \cdot c\right) \cdot a\right)\right) \cdot \left(\left(\color{blue}{\left(3 \cdot c\right) \cdot a} - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 65.5% accurate, 2.7× speedup?

\[\begin{array}{l} t_0 := \left(c \cdot a\right) \cdot 3\\ t_1 := \left(c \cdot a\right) \cdot -3\\ t_2 := \left|b\right| \cdot \left|b\right|\\ t_3 := t\_0 - t\_2\\ t_4 := \frac{0.3333333333333333 \cdot c}{a}\\ t_5 := \left(a \cdot a\right) \cdot a\\ \mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\ \;\;\;\;\left(t\_4 \cdot t\_4\right) \cdot t\_4\\ \mathbf{elif}\;\left|b\right| \leq 1.55 \cdot 10^{-77}:\\ \;\;\;\;t\_3 \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{\left(t\_2 - t\_0\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(t\_1 \cdot \frac{0.0013717421124828531}{t\_5 \cdot t\_5}\right) \cdot t\_3\right) \cdot t\_1\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (* c a) 3.0))
       (t_1 (* (* c a) -3.0))
       (t_2 (* (fabs b) (fabs b)))
       (t_3 (- t_0 t_2))
       (t_4 (/ (* 0.3333333333333333 c) a))
       (t_5 (* (* a a) a)))
  (if (<= (fabs b) 2.25e-138)
    (* (* t_4 t_4) t_4)
    (if (<= (fabs b) 1.55e-77)
      (*
       t_3
       (*
        (* -0.037037037037037035 (/ c a))
        (/ (* (- t_2 t_0) (/ 0.1111111111111111 (* a a))) (* a a))))
      (* (* (* t_1 (/ 0.0013717421124828531 (* t_5 t_5))) t_3) t_1)))))
double code(double a, double b, double c) {
	double t_0 = (c * a) * 3.0;
	double t_1 = (c * a) * -3.0;
	double t_2 = fabs(b) * fabs(b);
	double t_3 = t_0 - t_2;
	double t_4 = (0.3333333333333333 * c) / a;
	double t_5 = (a * a) * a;
	double tmp;
	if (fabs(b) <= 2.25e-138) {
		tmp = (t_4 * t_4) * t_4;
	} else if (fabs(b) <= 1.55e-77) {
		tmp = t_3 * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = ((t_1 * (0.0013717421124828531 / (t_5 * t_5))) * t_3) * t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: tmp
    t_0 = (c * a) * 3.0d0
    t_1 = (c * a) * (-3.0d0)
    t_2 = abs(b) * abs(b)
    t_3 = t_0 - t_2
    t_4 = (0.3333333333333333d0 * c) / a
    t_5 = (a * a) * a
    if (abs(b) <= 2.25d-138) then
        tmp = (t_4 * t_4) * t_4
    else if (abs(b) <= 1.55d-77) then
        tmp = t_3 * (((-0.037037037037037035d0) * (c / a)) * (((t_2 - t_0) * (0.1111111111111111d0 / (a * a))) / (a * a)))
    else
        tmp = ((t_1 * (0.0013717421124828531d0 / (t_5 * t_5))) * t_3) * t_1
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * a) * 3.0;
	double t_1 = (c * a) * -3.0;
	double t_2 = Math.abs(b) * Math.abs(b);
	double t_3 = t_0 - t_2;
	double t_4 = (0.3333333333333333 * c) / a;
	double t_5 = (a * a) * a;
	double tmp;
	if (Math.abs(b) <= 2.25e-138) {
		tmp = (t_4 * t_4) * t_4;
	} else if (Math.abs(b) <= 1.55e-77) {
		tmp = t_3 * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = ((t_1 * (0.0013717421124828531 / (t_5 * t_5))) * t_3) * t_1;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * a) * 3.0
	t_1 = (c * a) * -3.0
	t_2 = math.fabs(b) * math.fabs(b)
	t_3 = t_0 - t_2
	t_4 = (0.3333333333333333 * c) / a
	t_5 = (a * a) * a
	tmp = 0
	if math.fabs(b) <= 2.25e-138:
		tmp = (t_4 * t_4) * t_4
	elif math.fabs(b) <= 1.55e-77:
		tmp = t_3 * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)))
	else:
		tmp = ((t_1 * (0.0013717421124828531 / (t_5 * t_5))) * t_3) * t_1
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * a) * 3.0)
	t_1 = Float64(Float64(c * a) * -3.0)
	t_2 = Float64(abs(b) * abs(b))
	t_3 = Float64(t_0 - t_2)
	t_4 = Float64(Float64(0.3333333333333333 * c) / a)
	t_5 = Float64(Float64(a * a) * a)
	tmp = 0.0
	if (abs(b) <= 2.25e-138)
		tmp = Float64(Float64(t_4 * t_4) * t_4);
	elseif (abs(b) <= 1.55e-77)
		tmp = Float64(t_3 * Float64(Float64(-0.037037037037037035 * Float64(c / a)) * Float64(Float64(Float64(t_2 - t_0) * Float64(0.1111111111111111 / Float64(a * a))) / Float64(a * a))));
	else
		tmp = Float64(Float64(Float64(t_1 * Float64(0.0013717421124828531 / Float64(t_5 * t_5))) * t_3) * t_1);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * a) * 3.0;
	t_1 = (c * a) * -3.0;
	t_2 = abs(b) * abs(b);
	t_3 = t_0 - t_2;
	t_4 = (0.3333333333333333 * c) / a;
	t_5 = (a * a) * a;
	tmp = 0.0;
	if (abs(b) <= 2.25e-138)
		tmp = (t_4 * t_4) * t_4;
	elseif (abs(b) <= 1.55e-77)
		tmp = t_3 * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)));
	else
		tmp = ((t_1 * (0.0013717421124828531 / (t_5 * t_5))) * t_3) * t_1;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c * a), $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$5 = N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.25e-138], N[(N[(t$95$4 * t$95$4), $MachinePrecision] * t$95$4), $MachinePrecision], If[LessEqual[N[Abs[b], $MachinePrecision], 1.55e-77], N[(t$95$3 * N[(N[(-0.037037037037037035 * N[(c / a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$2 - t$95$0), $MachinePrecision] * N[(0.1111111111111111 / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * N[(0.0013717421124828531 / N[(t$95$5 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_0 := \left(c \cdot a\right) \cdot 3\\
t_1 := \left(c \cdot a\right) \cdot -3\\
t_2 := \left|b\right| \cdot \left|b\right|\\
t_3 := t\_0 - t\_2\\
t_4 := \frac{0.3333333333333333 \cdot c}{a}\\
t_5 := \left(a \cdot a\right) \cdot a\\
\mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\
\;\;\;\;\left(t\_4 \cdot t\_4\right) \cdot t\_4\\

\mathbf{elif}\;\left|b\right| \leq 1.55 \cdot 10^{-77}:\\
\;\;\;\;t\_3 \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{\left(t\_2 - t\_0\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 \cdot \frac{0.0013717421124828531}{t\_5 \cdot t\_5}\right) \cdot t\_3\right) \cdot t\_1\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.25e-138

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.25e-138 < b < 1.55e-77

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.6%

      \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\frac{0.1111111111111111 \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)} \cdot \left(\frac{0.1111111111111111}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right)\right)} \]
    3. Applied rewrites76.0%

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)} \]
    4. Taylor expanded in a around inf

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\color{blue}{\left(\frac{-1}{27} \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(\frac{-1}{27} \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      2. lower-/.f6452.6%

        \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{\color{blue}{a}}\right) \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    6. Applied rewrites52.6%

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\color{blue}{\left(-0.037037037037037035 \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]

    if 1.55e-77 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}}^{3} \]
      3. mult-flipN/A

        \[\leadsto {\color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \frac{1}{9 \cdot {a}^{2}}\right)}}^{3} \]
      4. cube-prodN/A

        \[\leadsto \color{blue}{{\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}^{3} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}} \]
      5. unpow3N/A

        \[\leadsto \color{blue}{\left(\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right)} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
    3. Applied rewrites40.3%

      \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
    4. Taylor expanded in a around inf

      \[\leadsto \left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)} \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(-3 \cdot \color{blue}{\left(a \cdot c\right)}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. lower-*.f6418.9%

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot \color{blue}{c}\right)\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    6. Applied rewrites18.9%

      \[\leadsto \left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)} \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    7. Taylor expanded in a around inf

      \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \color{blue}{\left(a \cdot c\right)}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. lower-*.f6417.4%

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot \color{blue}{c}\right)\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    9. Applied rewrites17.4%

      \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)} \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)} \]
    11. Applied rewrites35.8%

      \[\leadsto \color{blue}{\left(\left(\left(\left(c \cdot a\right) \cdot -3\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)}\right) \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right) \cdot \left(\left(c \cdot a\right) \cdot -3\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 65.5% accurate, 2.7× speedup?

\[\begin{array}{l} t_0 := \left(3 \cdot c\right) \cdot a\\ t_1 := \left(c \cdot a\right) \cdot -3\\ t_2 := \left|b\right| \cdot \left|b\right|\\ t_3 := \frac{0.3333333333333333 \cdot c}{a}\\ t_4 := \left(a \cdot a\right) \cdot a\\ \mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\ \;\;\;\;\left(t\_3 \cdot t\_3\right) \cdot t\_3\\ \mathbf{elif}\;\left|b\right| \leq 1.55 \cdot 10^{-77}:\\ \;\;\;\;\left(t\_0 - t\_2\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{\left(t\_2 - t\_0\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(t\_1 \cdot \frac{0.0013717421124828531}{t\_4 \cdot t\_4}\right) \cdot \left(\left(c \cdot a\right) \cdot 3 - t\_2\right)\right) \cdot t\_1\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (* 3.0 c) a))
       (t_1 (* (* c a) -3.0))
       (t_2 (* (fabs b) (fabs b)))
       (t_3 (/ (* 0.3333333333333333 c) a))
       (t_4 (* (* a a) a)))
  (if (<= (fabs b) 2.25e-138)
    (* (* t_3 t_3) t_3)
    (if (<= (fabs b) 1.55e-77)
      (*
       (- t_0 t_2)
       (*
        (* -0.037037037037037035 (/ c a))
        (/ (* (- t_2 t_0) (/ 0.1111111111111111 (* a a))) (* a a))))
      (*
       (*
        (* t_1 (/ 0.0013717421124828531 (* t_4 t_4)))
        (- (* (* c a) 3.0) t_2))
       t_1)))))
double code(double a, double b, double c) {
	double t_0 = (3.0 * c) * a;
	double t_1 = (c * a) * -3.0;
	double t_2 = fabs(b) * fabs(b);
	double t_3 = (0.3333333333333333 * c) / a;
	double t_4 = (a * a) * a;
	double tmp;
	if (fabs(b) <= 2.25e-138) {
		tmp = (t_3 * t_3) * t_3;
	} else if (fabs(b) <= 1.55e-77) {
		tmp = (t_0 - t_2) * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = ((t_1 * (0.0013717421124828531 / (t_4 * t_4))) * (((c * a) * 3.0) - t_2)) * t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = (3.0d0 * c) * a
    t_1 = (c * a) * (-3.0d0)
    t_2 = abs(b) * abs(b)
    t_3 = (0.3333333333333333d0 * c) / a
    t_4 = (a * a) * a
    if (abs(b) <= 2.25d-138) then
        tmp = (t_3 * t_3) * t_3
    else if (abs(b) <= 1.55d-77) then
        tmp = (t_0 - t_2) * (((-0.037037037037037035d0) * (c / a)) * (((t_2 - t_0) * (0.1111111111111111d0 / (a * a))) / (a * a)))
    else
        tmp = ((t_1 * (0.0013717421124828531d0 / (t_4 * t_4))) * (((c * a) * 3.0d0) - t_2)) * t_1
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (3.0 * c) * a;
	double t_1 = (c * a) * -3.0;
	double t_2 = Math.abs(b) * Math.abs(b);
	double t_3 = (0.3333333333333333 * c) / a;
	double t_4 = (a * a) * a;
	double tmp;
	if (Math.abs(b) <= 2.25e-138) {
		tmp = (t_3 * t_3) * t_3;
	} else if (Math.abs(b) <= 1.55e-77) {
		tmp = (t_0 - t_2) * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)));
	} else {
		tmp = ((t_1 * (0.0013717421124828531 / (t_4 * t_4))) * (((c * a) * 3.0) - t_2)) * t_1;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (3.0 * c) * a
	t_1 = (c * a) * -3.0
	t_2 = math.fabs(b) * math.fabs(b)
	t_3 = (0.3333333333333333 * c) / a
	t_4 = (a * a) * a
	tmp = 0
	if math.fabs(b) <= 2.25e-138:
		tmp = (t_3 * t_3) * t_3
	elif math.fabs(b) <= 1.55e-77:
		tmp = (t_0 - t_2) * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)))
	else:
		tmp = ((t_1 * (0.0013717421124828531 / (t_4 * t_4))) * (((c * a) * 3.0) - t_2)) * t_1
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(3.0 * c) * a)
	t_1 = Float64(Float64(c * a) * -3.0)
	t_2 = Float64(abs(b) * abs(b))
	t_3 = Float64(Float64(0.3333333333333333 * c) / a)
	t_4 = Float64(Float64(a * a) * a)
	tmp = 0.0
	if (abs(b) <= 2.25e-138)
		tmp = Float64(Float64(t_3 * t_3) * t_3);
	elseif (abs(b) <= 1.55e-77)
		tmp = Float64(Float64(t_0 - t_2) * Float64(Float64(-0.037037037037037035 * Float64(c / a)) * Float64(Float64(Float64(t_2 - t_0) * Float64(0.1111111111111111 / Float64(a * a))) / Float64(a * a))));
	else
		tmp = Float64(Float64(Float64(t_1 * Float64(0.0013717421124828531 / Float64(t_4 * t_4))) * Float64(Float64(Float64(c * a) * 3.0) - t_2)) * t_1);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (3.0 * c) * a;
	t_1 = (c * a) * -3.0;
	t_2 = abs(b) * abs(b);
	t_3 = (0.3333333333333333 * c) / a;
	t_4 = (a * a) * a;
	tmp = 0.0;
	if (abs(b) <= 2.25e-138)
		tmp = (t_3 * t_3) * t_3;
	elseif (abs(b) <= 1.55e-77)
		tmp = (t_0 - t_2) * ((-0.037037037037037035 * (c / a)) * (((t_2 - t_0) * (0.1111111111111111 / (a * a))) / (a * a)));
	else
		tmp = ((t_1 * (0.0013717421124828531 / (t_4 * t_4))) * (((c * a) * 3.0) - t_2)) * t_1;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(3.0 * c), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c * a), $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(0.3333333333333333 * c), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$4 = N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2.25e-138], N[(N[(t$95$3 * t$95$3), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[N[Abs[b], $MachinePrecision], 1.55e-77], N[(N[(t$95$0 - t$95$2), $MachinePrecision] * N[(N[(-0.037037037037037035 * N[(c / a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$2 - t$95$0), $MachinePrecision] * N[(0.1111111111111111 / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * N[(0.0013717421124828531 / N[(t$95$4 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot c\right) \cdot a\\
t_1 := \left(c \cdot a\right) \cdot -3\\
t_2 := \left|b\right| \cdot \left|b\right|\\
t_3 := \frac{0.3333333333333333 \cdot c}{a}\\
t_4 := \left(a \cdot a\right) \cdot a\\
\mathbf{if}\;\left|b\right| \leq 2.25 \cdot 10^{-138}:\\
\;\;\;\;\left(t\_3 \cdot t\_3\right) \cdot t\_3\\

\mathbf{elif}\;\left|b\right| \leq 1.55 \cdot 10^{-77}:\\
\;\;\;\;\left(t\_0 - t\_2\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{a}\right) \cdot \frac{\left(t\_2 - t\_0\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 \cdot \frac{0.0013717421124828531}{t\_4 \cdot t\_4}\right) \cdot \left(\left(c \cdot a\right) \cdot 3 - t\_2\right)\right) \cdot t\_1\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.25e-138

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Taylor expanded in a around inf

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. Step-by-step derivation
      1. lower-*.f6458.9%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    7. Applied rewrites58.9%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c}{a} \cdot \frac{\frac{1}{3} \cdot c}{a}\right) \cdot \frac{\frac{1}{3} \cdot c}{a}} \]
    9. Applied rewrites58.9%

      \[\leadsto \color{blue}{\left(\frac{0.3333333333333333 \cdot c}{a} \cdot \frac{0.3333333333333333 \cdot c}{a}\right) \cdot \frac{0.3333333333333333 \cdot c}{a}} \]

    if 2.25e-138 < b < 1.55e-77

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Applied rewrites66.6%

      \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \left(\frac{0.1111111111111111 \cdot \left(\left(c \cdot a\right) \cdot 0.3333333333333333 - \left(b \cdot b\right) \cdot 0.1111111111111111\right)}{\left(a \cdot a\right) \cdot \left(a \cdot a\right)} \cdot \left(\frac{0.1111111111111111}{a \cdot a} \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right)\right)} \]
    3. Applied rewrites76.0%

      \[\leadsto \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \color{blue}{\left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(c \cdot a\right) \cdot 3} - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\color{blue}{3 \cdot \left(c \cdot a\right)} - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(3 \cdot \color{blue}{\left(c \cdot a\right)} - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\color{blue}{\left(3 \cdot c\right) \cdot a} - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(3 \cdot c\right) \cdot a} - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      6. lower-*.f6476.1%

        \[\leadsto \left(\color{blue}{\left(3 \cdot c\right)} \cdot a - b \cdot b\right) \cdot \left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    5. Applied rewrites76.1%

      \[\leadsto \left(\color{blue}{\left(3 \cdot c\right) \cdot a} - b \cdot b\right) \cdot \left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \color{blue}{\left(c \cdot a\right) \cdot 3}\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \color{blue}{3 \cdot \left(c \cdot a\right)}\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - 3 \cdot \color{blue}{\left(c \cdot a\right)}\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\frac{\left(\frac{1}{9} \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot \frac{1}{3}\right) \cdot \frac{1}{9}}{a \cdot a} \cdot \frac{\left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      6. lower-*.f6476.1%

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \color{blue}{\left(3 \cdot c\right)} \cdot a\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    7. Applied rewrites76.1%

      \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\frac{\left(0.1111111111111111 \cdot \left(b \cdot b\right) - \left(c \cdot a\right) \cdot 0.3333333333333333\right) \cdot 0.1111111111111111}{a \cdot a} \cdot \frac{\left(b \cdot b - \color{blue}{\left(3 \cdot c\right) \cdot a}\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    8. Taylor expanded in a around inf

      \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\color{blue}{\left(\frac{-1}{27} \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\left(\frac{-1}{27} \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \frac{\frac{1}{9}}{a \cdot a}}{a \cdot a}\right) \]
      2. lower-/.f6452.6%

        \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\left(-0.037037037037037035 \cdot \frac{c}{\color{blue}{a}}\right) \cdot \frac{\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]
    10. Applied rewrites52.6%

      \[\leadsto \left(\left(3 \cdot c\right) \cdot a - b \cdot b\right) \cdot \left(\color{blue}{\left(-0.037037037037037035 \cdot \frac{c}{a}\right)} \cdot \frac{\left(b \cdot b - \left(3 \cdot c\right) \cdot a\right) \cdot \frac{0.1111111111111111}{a \cdot a}}{a \cdot a}\right) \]

    if 1.55e-77 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}}^{3} \]
      3. mult-flipN/A

        \[\leadsto {\color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \frac{1}{9 \cdot {a}^{2}}\right)}}^{3} \]
      4. cube-prodN/A

        \[\leadsto \color{blue}{{\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}^{3} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}} \]
      5. unpow3N/A

        \[\leadsto \color{blue}{\left(\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right)} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
    3. Applied rewrites40.3%

      \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
    4. Taylor expanded in a around inf

      \[\leadsto \left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)} \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(-3 \cdot \color{blue}{\left(a \cdot c\right)}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. lower-*.f6418.9%

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot \color{blue}{c}\right)\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    6. Applied rewrites18.9%

      \[\leadsto \left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)} \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    7. Taylor expanded in a around inf

      \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \color{blue}{\left(a \cdot c\right)}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. lower-*.f6417.4%

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot \color{blue}{c}\right)\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    9. Applied rewrites17.4%

      \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)} \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)} \]
    11. Applied rewrites35.8%

      \[\leadsto \color{blue}{\left(\left(\left(\left(c \cdot a\right) \cdot -3\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)}\right) \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right) \cdot \left(\left(c \cdot a\right) \cdot -3\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 63.4% accurate, 3.3× speedup?

\[\begin{array}{l} t_0 := \left(c \cdot a\right) \cdot -3\\ t_1 := \left(a \cdot a\right) \cdot a\\ t_2 := 0.3333333333333333 \cdot \frac{c}{a}\\ \mathbf{if}\;\left|b\right| \leq 1.25 \cdot 10^{-76}:\\ \;\;\;\;\left(t\_2 \cdot t\_2\right) \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(t\_0 \cdot \frac{0.0013717421124828531}{t\_1 \cdot t\_1}\right) \cdot \left(\left(c \cdot a\right) \cdot 3 - \left|b\right| \cdot \left|b\right|\right)\right) \cdot t\_0\\ \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* (* c a) -3.0))
       (t_1 (* (* a a) a))
       (t_2 (* 0.3333333333333333 (/ c a))))
  (if (<= (fabs b) 1.25e-76)
    (* (* t_2 t_2) t_2)
    (*
     (*
      (* t_0 (/ 0.0013717421124828531 (* t_1 t_1)))
      (- (* (* c a) 3.0) (* (fabs b) (fabs b))))
     t_0))))
double code(double a, double b, double c) {
	double t_0 = (c * a) * -3.0;
	double t_1 = (a * a) * a;
	double t_2 = 0.3333333333333333 * (c / a);
	double tmp;
	if (fabs(b) <= 1.25e-76) {
		tmp = (t_2 * t_2) * t_2;
	} else {
		tmp = ((t_0 * (0.0013717421124828531 / (t_1 * t_1))) * (((c * a) * 3.0) - (fabs(b) * fabs(b)))) * t_0;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (c * a) * (-3.0d0)
    t_1 = (a * a) * a
    t_2 = 0.3333333333333333d0 * (c / a)
    if (abs(b) <= 1.25d-76) then
        tmp = (t_2 * t_2) * t_2
    else
        tmp = ((t_0 * (0.0013717421124828531d0 / (t_1 * t_1))) * (((c * a) * 3.0d0) - (abs(b) * abs(b)))) * t_0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * a) * -3.0;
	double t_1 = (a * a) * a;
	double t_2 = 0.3333333333333333 * (c / a);
	double tmp;
	if (Math.abs(b) <= 1.25e-76) {
		tmp = (t_2 * t_2) * t_2;
	} else {
		tmp = ((t_0 * (0.0013717421124828531 / (t_1 * t_1))) * (((c * a) * 3.0) - (Math.abs(b) * Math.abs(b)))) * t_0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * a) * -3.0
	t_1 = (a * a) * a
	t_2 = 0.3333333333333333 * (c / a)
	tmp = 0
	if math.fabs(b) <= 1.25e-76:
		tmp = (t_2 * t_2) * t_2
	else:
		tmp = ((t_0 * (0.0013717421124828531 / (t_1 * t_1))) * (((c * a) * 3.0) - (math.fabs(b) * math.fabs(b)))) * t_0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * a) * -3.0)
	t_1 = Float64(Float64(a * a) * a)
	t_2 = Float64(0.3333333333333333 * Float64(c / a))
	tmp = 0.0
	if (abs(b) <= 1.25e-76)
		tmp = Float64(Float64(t_2 * t_2) * t_2);
	else
		tmp = Float64(Float64(Float64(t_0 * Float64(0.0013717421124828531 / Float64(t_1 * t_1))) * Float64(Float64(Float64(c * a) * 3.0) - Float64(abs(b) * abs(b)))) * t_0);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * a) * -3.0;
	t_1 = (a * a) * a;
	t_2 = 0.3333333333333333 * (c / a);
	tmp = 0.0;
	if (abs(b) <= 1.25e-76)
		tmp = (t_2 * t_2) * t_2;
	else
		tmp = ((t_0 * (0.0013717421124828531 / (t_1 * t_1))) * (((c * a) * 3.0) - (abs(b) * abs(b)))) * t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * a), $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a * a), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(0.3333333333333333 * N[(c / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 1.25e-76], N[(N[(t$95$2 * t$95$2), $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(N[(t$95$0 * N[(0.0013717421124828531 / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c * a), $MachinePrecision] * 3.0), $MachinePrecision] - N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(c \cdot a\right) \cdot -3\\
t_1 := \left(a \cdot a\right) \cdot a\\
t_2 := 0.3333333333333333 \cdot \frac{c}{a}\\
\mathbf{if}\;\left|b\right| \leq 1.25 \cdot 10^{-76}:\\
\;\;\;\;\left(t\_2 \cdot t\_2\right) \cdot t\_2\\

\mathbf{else}:\\
\;\;\;\;\left(\left(t\_0 \cdot \frac{0.0013717421124828531}{t\_1 \cdot t\_1}\right) \cdot \left(\left(c \cdot a\right) \cdot 3 - \left|b\right| \cdot \left|b\right|\right)\right) \cdot t\_0\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.2499999999999999e-76

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Taylor expanded in a around inf

      \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
      2. lower-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      3. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      4. lower-/.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      5. lower-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      6. lower-*.f6494.0%

        \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
    4. Applied rewrites94.0%

      \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
      2. +-commutativeN/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c + \frac{-1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      3. lift-*.f64N/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c + \frac{-1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      4. fp-cancel-sign-sub-invN/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \left(\mathsf{neg}\left(\frac{-1}{9}\right)\right) \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      5. lower--.f64N/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \left(\mathsf{neg}\left(\frac{-1}{9}\right)\right) \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      7. lower-*.f6494.0%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      8. lift-/.f64N/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      9. lift-pow.f64N/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
      10. pow2N/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{b \cdot b}{a}}{a}\right)}^{3} \]
      11. associate-/l*N/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
      12. lower-*.f64N/A

        \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
      13. lower-/.f6499.3%

        \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
    6. Applied rewrites99.3%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
    7. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3}} \]
      2. unpow3N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a} \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right) \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a} \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right) \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}} \]
    8. Applied rewrites99.3%

      \[\leadsto \color{blue}{\left(\frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}} \]
    9. Taylor expanded in a around inf

      \[\leadsto \left(\left(\frac{1}{3} \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(\frac{1}{3} \cdot \frac{c}{\color{blue}{a}}\right) \cdot \frac{\frac{-1}{9} \cdot \left(\frac{b}{a} \cdot b\right) - \frac{-1}{3} \cdot c}{a}\right) \cdot \frac{\frac{-1}{9} \cdot \left(\frac{b}{a} \cdot b\right) - \frac{-1}{3} \cdot c}{a} \]
      2. lower-/.f6466.9%

        \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
    11. Applied rewrites66.9%

      \[\leadsto \left(\left(0.3333333333333333 \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
    12. Taylor expanded in a around inf

      \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(\frac{1}{3} \cdot \color{blue}{\frac{c}{a}}\right)\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
    13. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(\frac{1}{3} \cdot \frac{c}{a}\right) \cdot \left(\frac{1}{3} \cdot \frac{c}{\color{blue}{a}}\right)\right) \cdot \frac{\frac{-1}{9} \cdot \left(\frac{b}{a} \cdot b\right) - \frac{-1}{3} \cdot c}{a} \]
      2. lower-/.f6475.1%

        \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
    14. Applied rewrites75.1%

      \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \color{blue}{\frac{c}{a}}\right)\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
    15. Taylor expanded in a around inf

      \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \left(\frac{1}{3} \cdot \color{blue}{\frac{c}{a}}\right) \]
    16. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(\frac{1}{3} \cdot \frac{c}{a}\right) \cdot \left(\frac{1}{3} \cdot \frac{c}{a}\right)\right) \cdot \left(\frac{1}{3} \cdot \frac{c}{\color{blue}{a}}\right) \]
      2. lower-/.f6458.9%

        \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right) \]
    17. Applied rewrites58.9%

      \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \left(0.3333333333333333 \cdot \color{blue}{\frac{c}{a}}\right) \]

    if 1.2499999999999999e-76 < b

    1. Initial program 81.1%

      \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
    2. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}}^{3} \]
      3. mult-flipN/A

        \[\leadsto {\color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \frac{1}{9 \cdot {a}^{2}}\right)}}^{3} \]
      4. cube-prodN/A

        \[\leadsto \color{blue}{{\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)}^{3} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}} \]
      5. unpow3N/A

        \[\leadsto \color{blue}{\left(\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right)} \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot \left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right)\right) \cdot \left(\left(3 \cdot \left(a \cdot c\right) - {b}^{2}\right) \cdot {\left(\frac{1}{9 \cdot {a}^{2}}\right)}^{3}\right)} \]
    3. Applied rewrites40.3%

      \[\leadsto \color{blue}{\left(\left(b \cdot b - \left(c \cdot a\right) \cdot 3\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
    4. Taylor expanded in a around inf

      \[\leadsto \left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)} \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(-3 \cdot \color{blue}{\left(a \cdot c\right)}\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. lower-*.f6418.9%

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot \color{blue}{c}\right)\right) \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    6. Applied rewrites18.9%

      \[\leadsto \left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)} \cdot \left(b \cdot b - \left(c \cdot a\right) \cdot 3\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    7. Taylor expanded in a around inf

      \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \color{blue}{\left(a \cdot c\right)}\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      2. lower-*.f6417.4%

        \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot \color{blue}{c}\right)\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    9. Applied rewrites17.4%

      \[\leadsto \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)} \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right) \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(\left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right) \cdot \frac{\frac{1}{729}}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)} \]
    11. Applied rewrites35.8%

      \[\leadsto \color{blue}{\left(\left(\left(\left(c \cdot a\right) \cdot -3\right) \cdot \frac{0.0013717421124828531}{\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)}\right) \cdot \left(\left(c \cdot a\right) \cdot 3 - b \cdot b\right)\right) \cdot \left(\left(c \cdot a\right) \cdot -3\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 58.9% accurate, 5.6× speedup?

\[\begin{array}{l} t_0 := 0.3333333333333333 \cdot \frac{c}{a}\\ \left(t\_0 \cdot t\_0\right) \cdot t\_0 \end{array} \]
(FPCore (a b c)
  :precision binary64
  (let* ((t_0 (* 0.3333333333333333 (/ c a)))) (* (* t_0 t_0) t_0)))
double code(double a, double b, double c) {
	double t_0 = 0.3333333333333333 * (c / a);
	return (t_0 * t_0) * t_0;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    t_0 = 0.3333333333333333d0 * (c / a)
    code = (t_0 * t_0) * t_0
end function
public static double code(double a, double b, double c) {
	double t_0 = 0.3333333333333333 * (c / a);
	return (t_0 * t_0) * t_0;
}
def code(a, b, c):
	t_0 = 0.3333333333333333 * (c / a)
	return (t_0 * t_0) * t_0
function code(a, b, c)
	t_0 = Float64(0.3333333333333333 * Float64(c / a))
	return Float64(Float64(t_0 * t_0) * t_0)
end
function tmp = code(a, b, c)
	t_0 = 0.3333333333333333 * (c / a);
	tmp = (t_0 * t_0) * t_0;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(c / a), $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$0 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \frac{c}{a}\\
\left(t\_0 \cdot t\_0\right) \cdot t\_0
\end{array}
Derivation
  1. Initial program 81.1%

    \[{\left(\frac{3 \cdot \left(a \cdot c\right) - {b}^{2}}{9 \cdot {a}^{2}}\right)}^{3} \]
  2. Taylor expanded in a around inf

    \[\leadsto {\color{blue}{\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}}^{3} \]
  3. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{\color{blue}{a}}\right)}^{3} \]
    2. lower-+.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    3. lower-*.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    4. lower-/.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    5. lower-pow.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    6. lower-*.f6494.0%

      \[\leadsto {\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}^{3} \]
  4. Applied rewrites94.0%

    \[\leadsto {\color{blue}{\left(\frac{-0.1111111111111111 \cdot \frac{{b}^{2}}{a} + 0.3333333333333333 \cdot c}{a}\right)}}^{3} \]
  5. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{9} \cdot \frac{{b}^{2}}{a} + \frac{1}{3} \cdot c}{a}\right)}^{3} \]
    2. +-commutativeN/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c + \frac{-1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    3. lift-*.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c + \frac{-1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    4. fp-cancel-sign-sub-invN/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \left(\mathsf{neg}\left(\frac{-1}{9}\right)\right) \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    5. lower--.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \left(\mathsf{neg}\left(\frac{-1}{9}\right)\right) \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    6. metadata-evalN/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    7. lower-*.f6494.0%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    8. lift-/.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    9. lift-pow.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{{b}^{2}}{a}}{a}\right)}^{3} \]
    10. pow2N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \frac{b \cdot b}{a}}{a}\right)}^{3} \]
    11. associate-/l*N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
    12. lower-*.f64N/A

      \[\leadsto {\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
    13. lower-/.f6499.3%

      \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
  6. Applied rewrites99.3%

    \[\leadsto {\left(\frac{0.3333333333333333 \cdot c - 0.1111111111111111 \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3} \]
  7. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right)}^{3}} \]
    2. unpow3N/A

      \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a} \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right) \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}} \]
    3. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(\frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a} \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}\right) \cdot \frac{\frac{1}{3} \cdot c - \frac{1}{9} \cdot \left(b \cdot \frac{b}{a}\right)}{a}} \]
  8. Applied rewrites99.3%

    \[\leadsto \color{blue}{\left(\frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}} \]
  9. Taylor expanded in a around inf

    \[\leadsto \left(\left(\frac{1}{3} \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
  10. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \left(\left(\frac{1}{3} \cdot \frac{c}{\color{blue}{a}}\right) \cdot \frac{\frac{-1}{9} \cdot \left(\frac{b}{a} \cdot b\right) - \frac{-1}{3} \cdot c}{a}\right) \cdot \frac{\frac{-1}{9} \cdot \left(\frac{b}{a} \cdot b\right) - \frac{-1}{3} \cdot c}{a} \]
    2. lower-/.f6466.9%

      \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
  11. Applied rewrites66.9%

    \[\leadsto \left(\left(0.3333333333333333 \cdot \color{blue}{\frac{c}{a}}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a}\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
  12. Taylor expanded in a around inf

    \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(\frac{1}{3} \cdot \color{blue}{\frac{c}{a}}\right)\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
  13. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \left(\left(\frac{1}{3} \cdot \frac{c}{a}\right) \cdot \left(\frac{1}{3} \cdot \frac{c}{\color{blue}{a}}\right)\right) \cdot \frac{\frac{-1}{9} \cdot \left(\frac{b}{a} \cdot b\right) - \frac{-1}{3} \cdot c}{a} \]
    2. lower-/.f6475.1%

      \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
  14. Applied rewrites75.1%

    \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \color{blue}{\frac{c}{a}}\right)\right) \cdot \frac{-0.1111111111111111 \cdot \left(\frac{b}{a} \cdot b\right) - -0.3333333333333333 \cdot c}{a} \]
  15. Taylor expanded in a around inf

    \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \left(\frac{1}{3} \cdot \color{blue}{\frac{c}{a}}\right) \]
  16. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \left(\left(\frac{1}{3} \cdot \frac{c}{a}\right) \cdot \left(\frac{1}{3} \cdot \frac{c}{a}\right)\right) \cdot \left(\frac{1}{3} \cdot \frac{c}{\color{blue}{a}}\right) \]
    2. lower-/.f6458.9%

      \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right) \]
  17. Applied rewrites58.9%

    \[\leadsto \left(\left(0.3333333333333333 \cdot \frac{c}{a}\right) \cdot \left(0.3333333333333333 \cdot \frac{c}{a}\right)\right) \cdot \left(0.3333333333333333 \cdot \color{blue}{\frac{c}{a}}\right) \]
  18. Add Preprocessing

Reproduce

?
herbie shell --seed 2025258 
(FPCore (a b c)
  :name "Q^3 (Cubic Equation Discriminant Part)"
  :precision binary64
  :pre (and (and (and (<= -1000000000.0 a) (<= a 1000000000.0)) (and (<= -1000000000.0 b) (<= b 1000000000.0))) (and (<= -1000000000.0 c) (<= c 1000000000.0)))
  (pow (/ (- (* 3.0 (* a c)) (pow b 2.0)) (* 9.0 (pow a 2.0))) 3.0))