Average Error: 0.0 → 0.0
Time: 3.2s
Precision: binary64
Cost: 13376
$\left(-1000000000 \leq a \land a \leq 1000000000\right) \land \left(-1000000000 \leq b \land b \leq 1000000000\right)$
$\left(1 - \left(a \cdot a\right) \cdot a\right) \cdot \left(1 - \left(b \cdot b\right) \cdot b\right)$
$\left(1 - {a}^{3}\right) \cdot \left(1 - {b}^{3}\right)$
(FPCore (a b)
:precision binary64
(* (- 1.0 (* (* a a) a)) (- 1.0 (* (* b b) b))))
(FPCore (a b) :precision binary64 (* (- 1.0 (pow a 3.0)) (- 1.0 (pow b 3.0))))
double code(double a, double b) {
return (1.0 - ((a * a) * a)) * (1.0 - ((b * b) * b));
}

double code(double a, double b) {
return (1.0 - pow(a, 3.0)) * (1.0 - pow(b, 3.0));
}

real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (1.0d0 - ((a * a) * a)) * (1.0d0 - ((b * b) * b))
end function

real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (1.0d0 - (a ** 3.0d0)) * (1.0d0 - (b ** 3.0d0))
end function

public static double code(double a, double b) {
return (1.0 - ((a * a) * a)) * (1.0 - ((b * b) * b));
}

public static double code(double a, double b) {
return (1.0 - Math.pow(a, 3.0)) * (1.0 - Math.pow(b, 3.0));
}

def code(a, b):
return (1.0 - ((a * a) * a)) * (1.0 - ((b * b) * b))

def code(a, b):
return (1.0 - math.pow(a, 3.0)) * (1.0 - math.pow(b, 3.0))

function code(a, b)
return Float64(Float64(1.0 - Float64(Float64(a * a) * a)) * Float64(1.0 - Float64(Float64(b * b) * b)))
end

function code(a, b)
return Float64(Float64(1.0 - (a ^ 3.0)) * Float64(1.0 - (b ^ 3.0)))
end

function tmp = code(a, b)
tmp = (1.0 - ((a * a) * a)) * (1.0 - ((b * b) * b));
end

function tmp = code(a, b)
tmp = (1.0 - (a ^ 3.0)) * (1.0 - (b ^ 3.0));
end

code[a_, b_] := N[(N[(1.0 - N[(N[(a * a), $MachinePrecision] * a),$MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(b * b),$MachinePrecision] * b), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]  code[a_, b_] := N[(N[(1.0 - N[Power[a, 3.0],$MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Power[b, 3.0],$MachinePrecision]), $MachinePrecision]),$MachinePrecision]

\left(1 - \left(a \cdot a\right) \cdot a\right) \cdot \left(1 - \left(b \cdot b\right) \cdot b\right)

\left(1 - {a}^{3}\right) \cdot \left(1 - {b}^{3}\right)


# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\left(1 - \left(a \cdot a\right) \cdot a\right) \cdot \left(1 - \left(b \cdot b\right) \cdot b\right)$
2. Simplified0.0

$\leadsto \color{blue}{\left(1 - {a}^{3}\right) \cdot \left(1 - {b}^{3}\right)}$
3. Final simplification0.0

$\leadsto \left(1 - {a}^{3}\right) \cdot \left(1 - {b}^{3}\right)$

# Alternatives

Alternative 1
Error0.0
Cost7168
$\left(1 - {a}^{3}\right) \cdot \left(1 - b \cdot \left(b \cdot b\right)\right)$
Alternative 2
Error0.0
Cost7168
$\left(1 - {b}^{3}\right) \cdot \left(1 - a \cdot \left(a \cdot a\right)\right)$
Alternative 3
Error0.0
Cost960
$\left(1 - a \cdot \left(a \cdot a\right)\right) \cdot \left(1 - b \cdot \left(b \cdot b\right)\right)$

# Reproduce

herbie shell --seed 1
(FPCore (a b)
:name "(1-a*a*a)*(1-b*b*b)"
:precision binary64
:pre (and (and (<= -1000000000.0 a) (<= a 1000000000.0)) (and (<= -1000000000.0 b) (<= b 1000000000.0)))
(* (- 1.0 (* (* a a) a)) (- 1.0 (* (* b b) b))))