Average Error: 5.5 → 3.8
Time: 21.1s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.873862549006095 \cdot 10^{-137}:\\ \;\;\;\;\left(\left(b \cdot c + \left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - j \cdot \left(27.0 \cdot k\right)\\ \mathbf{elif}\;t \le -4.5600303819773435 \cdot 10^{-268}:\\ \;\;\;\;\left(\left(b \cdot c + \left(-t\right) \cdot \left(a \cdot 4.0\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(j \cdot k\right) \cdot 27.0\\ \mathbf{elif}\;t \le 1.144781184301266 \cdot 10^{+81}:\\ \;\;\;\;\left(\left(b \cdot c + \left(\left(t \cdot z\right) \cdot \left(\left(x \cdot 18.0\right) \cdot y\right) - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(j \cdot k\right) \cdot 27.0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot \left(y \cdot z\right)\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(j \cdot k\right) \cdot 27.0\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Bits error versus j

Bits error versus k

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if t < -2.873862549006095e-137

    1. Initial program 3.0

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Using strategy rm
    3. Applied associate-*l*3.2

      \[\leadsto \left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \color{blue}{j \cdot \left(27.0 \cdot k\right)}\]

    if -2.873862549006095e-137 < t < -4.5600303819773435e-268

    1. Initial program 9.0

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Taylor expanded around inf 8.9

      \[\leadsto \left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \color{blue}{27.0 \cdot \left(j \cdot k\right)}\]
    3. Taylor expanded around 0 5.6

      \[\leadsto \left(\left(\left(\color{blue}{0} - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - 27.0 \cdot \left(j \cdot k\right)\]

    if -4.5600303819773435e-268 < t < 1.144781184301266e+81

    1. Initial program 7.3

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Taylor expanded around inf 7.3

      \[\leadsto \left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \color{blue}{27.0 \cdot \left(j \cdot k\right)}\]
    3. Using strategy rm
    4. Applied associate-*l*4.3

      \[\leadsto \left(\left(\left(\color{blue}{\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot \left(z \cdot t\right)} - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - 27.0 \cdot \left(j \cdot k\right)\]

    if 1.144781184301266e+81 < t

    1. Initial program 1.5

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Taylor expanded around inf 1.4

      \[\leadsto \left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \color{blue}{27.0 \cdot \left(j \cdot k\right)}\]
    3. Using strategy rm
    4. Applied associate-*l*1.4

      \[\leadsto \left(\left(\left(\color{blue}{\left(\left(x \cdot 18.0\right) \cdot \left(y \cdot z\right)\right)} \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - 27.0 \cdot \left(j \cdot k\right)\]
  3. Recombined 4 regimes into one program.
  4. Final simplification3.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.873862549006095 \cdot 10^{-137}:\\ \;\;\;\;\left(\left(b \cdot c + \left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - j \cdot \left(27.0 \cdot k\right)\\ \mathbf{elif}\;t \le -4.5600303819773435 \cdot 10^{-268}:\\ \;\;\;\;\left(\left(b \cdot c + \left(-t\right) \cdot \left(a \cdot 4.0\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(j \cdot k\right) \cdot 27.0\\ \mathbf{elif}\;t \le 1.144781184301266 \cdot 10^{+81}:\\ \;\;\;\;\left(\left(b \cdot c + \left(\left(t \cdot z\right) \cdot \left(\left(x \cdot 18.0\right) \cdot y\right) - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(j \cdot k\right) \cdot 27.0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot \left(y \cdot z\right)\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(j \cdot k\right) \cdot 27.0\\ \end{array}\]

Reproduce

herbie shell --seed 2019016 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))

Details

Time bar (total: 19.5s)Debug log

sample181.0ms

Algorithm
intervals
Results
525×(pre true 80)
525×(body real 80)

simplify415.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
415.0ms
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

prune34.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 3.9b

localize44.0ms

Local error

Found 4 expressions with local error:

7.6b
(* (* (* x 18.0) y) z)
6.4b
(* (* (* (* x 18.0) y) z) t)
0.3b
(* (* j 27.0) k)
0.2b
(* (* x 18.0) y)

rewrite31.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
add-cube-cbrt
*-commutative
add-exp-log
associate-*l*
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
4 → 44
Calls
4 calls:
Slowest
13.0ms
(* (* (* (* x 18.0) y) z) t)
9.0ms
(* (* j 27.0) k)
6.0ms
(* (* (* x 18.0) y) z)
2.0ms
(* (* x 18.0) y)

series117.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
51.0ms
(* (* (* (* x 18.0) y) z) t)
29.0ms
(* (* (* x 18.0) y) z)
22.0ms
(* (* j 27.0) k)
15.0ms
(* (* x 18.0) y)

simplify378.0ms

Counts
14 → 56
Calls
14 calls:
Slowest
138.0ms
(* 18.0 (* t (* x (* z y))))
137.0ms
(* 18.0 (* t (* x (* z y))))
25.0ms
(* 18.0 (* x (* z y)))
24.0ms
(* 18.0 (* x (* z y)))
7.0ms
(* 18.0 (* x y))

prune1.1s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.1b

localize17.0ms

Local error

Found 4 expressions with local error:

7.6b
(* (* (* x 18.0) y) z)
6.4b
(* (* (* (* x 18.0) y) z) t)
0.3b
(* 27.0 (* j k))
0.2b
(* (* x 18.0) y)

rewrite26.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
add-cube-cbrt
*-commutative
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
associate-*l*
associate-*r*
Counts
4 → 44
Calls
4 calls:
Slowest
14.0ms
(* (* (* (* x 18.0) y) z) t)
8.0ms
(* (* (* x 18.0) y) z)
2.0ms
(* (* x 18.0) y)
1.0ms
(* 27.0 (* j k))

series105.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
47.0ms
(* (* (* (* x 18.0) y) z) t)
32.0ms
(* (* (* x 18.0) y) z)
13.0ms
(* (* x 18.0) y)
13.0ms
(* 27.0 (* j k))

simplify485.0ms

Counts
14 → 56
Calls
14 calls:
Slowest
167.0ms
(* 18.0 (* t (* x (* z y))))
155.0ms
(* 18.0 (* t (* x (* z y))))
46.0ms
(* 18.0 (* x (* z y)))
26.0ms
(* 18.0 (* x (* z y)))
14.0ms
(* 27.0 (* j k))

prune1.1s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize23.0ms

Local error

Found 4 expressions with local error:

17.1b
(cbrt (* (* (* x 18.0) y) z))
17.1b
(cbrt (* (* (* x 18.0) y) z))
17.1b
(cbrt (* (* (* x 18.0) y) z))
7.6b
(* (* (* x 18.0) y) z)

rewrite17.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
pow1/3
cbrt-prod
*-commutative
associate-*l*
Counts
4 → 44
Calls
4 calls:
Slowest
6.0ms
(* (* (* x 18.0) y) z)
4.0ms
(cbrt (* (* (* x 18.0) y) z))
4.0ms
(cbrt (* (* (* x 18.0) y) z))
4.0ms
(cbrt (* (* (* x 18.0) y) z))

series434.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
143.0ms
(cbrt (* (* (* x 18.0) y) z))
138.0ms
(cbrt (* (* (* x 18.0) y) z))
128.0ms
(cbrt (* (* (* x 18.0) y) z))
26.0ms
(* (* (* x 18.0) y) z)

simplify1.5s

Counts
16 → 56
Calls
16 calls:
Slowest
199.0ms
(* (cbrt 18.0) (exp (* -1/3 (+ (log (/ 1 z)) (+ (log (/ 1 x)) (log (/ 1 y)))))))
183.0ms
(* (cbrt 18.0) (exp (* -1/3 (+ (log (/ 1 z)) (+ (log (/ 1 x)) (log (/ 1 y)))))))
176.0ms
(* (cbrt -18.0) (exp (* -1/3 (+ (log (/ -1 x)) (+ (log (/ -1 z)) (log (/ -1 y)))))))
165.0ms
(* (cbrt 18.0) (exp (* -1/3 (+ (log (/ 1 z)) (+ (log (/ 1 x)) (log (/ 1 y)))))))
160.0ms
(* (cbrt -18.0) (exp (* -1/3 (+ (log (/ -1 x)) (+ (log (/ -1 z)) (log (/ -1 y)))))))

prune1.3s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.0b

localize25.0ms

Local error

Found 4 expressions with local error:

8.5b
(cbrt (* 27.0 (* j k)))
8.5b
(cbrt (* 27.0 (* j k)))
8.5b
(cbrt (* 27.0 (* j k)))
7.6b
(* (* (* x 18.0) y) z)

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
pow1/3
cbrt-prod
*-commutative
associate-*l*
Counts
4 → 44
Calls
4 calls:
Slowest
9.0ms
(* (* (* x 18.0) y) z)
1.0ms
(cbrt (* 27.0 (* j k)))
1.0ms
(cbrt (* 27.0 (* j k)))
1.0ms
(cbrt (* 27.0 (* j k)))

series389.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
147.0ms
(cbrt (* 27.0 (* j k)))
105.0ms
(cbrt (* 27.0 (* j k)))
102.0ms
(cbrt (* 27.0 (* j k)))
34.0ms
(* (* (* x 18.0) y) z)

simplify991.0ms

Counts
16 → 56
Calls
16 calls:
Slowest
165.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ 1 k)) (log (/ 1 j))))))
129.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ -1 j)) (log (/ -1 k))))))
126.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ 1 k)) (log (/ 1 j))))))
124.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ -1 j)) (log (/ -1 k))))))
107.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ 1 k)) (log (/ 1 j))))))

prune1.3s

Pruning

8 alts after pruning (6 fresh and 2 done)

Merged error: 0.0b

regimes2.3s

Accuracy

36.1% (3.1b remaining)

Error of 3.8b against oracle of 0.6b and baseline of 5.5b

bsearch905.0ms

end0.0ms

sample6.2s

Algorithm
intervals
Results
16039×(pre true 80)
16039×(body real 80)