(FPCore (x) :precision binary64 (- x (* (floor (/ (+ x 3.14) 3.14)) 3.14)))
double code(double x) { return x - (floor(((x + 3.14) / 3.14)) * 3.14); }
public static double code(double x) { return x - (Math.floor(((x + 3.14) / 3.14)) * 3.14); }
def code(x): return x - (math.floor(((x + 3.14) / 3.14)) * 3.14)
function code(x) return Float64(x - Float64(floor(Float64(Float64(x + 3.14) / 3.14)) * 3.14)) end
function tmp = code(x) tmp = x - (floor(((x + 3.14) / 3.14)) * 3.14); end
code[x_] := N[(x - N[(N[Floor[N[(N[(x + 3.14), $MachinePrecision] / 3.14), $MachinePrecision]], $MachinePrecision] * 3.14), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ x - \left\lfloor \frac{x + 3.14}{3.14}\right\rfloor \cdot 3.14 \end{array}
Sampling outcomes in binary64 precision:
Herbie found 6 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x) :precision binary64 (- x (* (floor (/ (+ x 3.14) 3.14)) 3.14)))
double code(double x) { return x - (floor(((x + 3.14) / 3.14)) * 3.14); }
public static double code(double x) { return x - (Math.floor(((x + 3.14) / 3.14)) * 3.14); }
def code(x): return x - (math.floor(((x + 3.14) / 3.14)) * 3.14)
function code(x) return Float64(x - Float64(floor(Float64(Float64(x + 3.14) / 3.14)) * 3.14)) end
function tmp = code(x) tmp = x - (floor(((x + 3.14) / 3.14)) * 3.14); end
code[x_] := N[(x - N[(N[Floor[N[(N[(x + 3.14), $MachinePrecision] / 3.14), $MachinePrecision]], $MachinePrecision] * 3.14), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ x - \left\lfloor \frac{x + 3.14}{3.14}\right\rfloor \cdot 3.14 \end{array}
(FPCore (x) :precision binary64 (if (<= x -2e-310) (- x (* (floor (* (fma x x -9.8596) (* (pow (- x 3.14) -1.0) 0.3184713375796178))) 3.14)) (fma (floor (/ (* (fma x x -9.8596) 0.3184713375796178) (- x 3.14))) -3.14 x)))
double code(double x) { double tmp; if (x <= -2e-310) { tmp = x - (floor((fma(x, x, -9.8596) * (pow((x - 3.14), -1.0) * 0.3184713375796178))) * 3.14); } else { tmp = fma(floor(((fma(x, x, -9.8596) * 0.3184713375796178) / (x - 3.14))), -3.14, x); } return tmp; }
function code(x) tmp = 0.0 if (x <= -2e-310) tmp = Float64(x - Float64(floor(Float64(fma(x, x, -9.8596) * Float64((Float64(x - 3.14) ^ -1.0) * 0.3184713375796178))) * 3.14)); else tmp = fma(floor(Float64(Float64(fma(x, x, -9.8596) * 0.3184713375796178) / Float64(x - 3.14))), -3.14, x); end return tmp end
code[x_] := If[LessEqual[x, -2e-310], N[(x - N[(N[Floor[N[(N[(x * x + -9.8596), $MachinePrecision] * N[(N[Power[N[(x - 3.14), $MachinePrecision], -1.0], $MachinePrecision] * 0.3184713375796178), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 3.14), $MachinePrecision]), $MachinePrecision], N[(N[Floor[N[(N[(N[(x * x + -9.8596), $MachinePrecision] * 0.3184713375796178), $MachinePrecision] / N[(x - 3.14), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-310}:\\ \;\;\;\;x - \left\lfloor \mathsf{fma}\left(x, x, -9.8596\right) \cdot \left({\left(x - 3.14\right)}^{-1} \cdot 0.3184713375796178\right)\right\rfloor \cdot 3.14\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left\lfloor \frac{\mathsf{fma}\left(x, x, -9.8596\right) \cdot 0.3184713375796178}{x - 3.14}\right\rfloor , -3.14, x\right)\\ \end{array} \end{array}
if x < -1.999999999999994e-310
Initial program 7.1%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
div-inv
N/A
associate-*l*
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-*.f64
N/A
inv-pow
N/A
lower-pow.f64
N/A
lower--.f64
N/A
metadata-eval
56.3
Applied rewrites56.3%
if -1.999999999999994e-310 < x
Initial program 47.4%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
div-inv
N/A
associate-*l*
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-*.f64
N/A
inv-pow
N/A
lower-pow.f64
N/A
lower--.f64
N/A
metadata-eval
7.4
Applied rewrites7.4%
Taylor expanded in x around 0
cancel-sign-sub-inv
N/A
metadata-eval
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower-floor.f64
N/A
associate-*r/
N/A
lower-/.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
sub-neg
N/A
unpow2
N/A
metadata-eval
N/A
lower-fma.f64
N/A
lower--.f64
48.3
Applied rewrites48.3%
(FPCore (x) :precision binary64 (if (<= x -2.7e-77) (fma (floor (fma 0.3184713375796178 x 1.0)) -3.14 x) (if (<= x -2e-310) (- x (* (floor (pow (/ (+ (/ (- -9.8596 (/ (- (/ 97.21171216000002 x) 30.959144000000002) x)) x) 3.14) x) -1.0)) 3.14)) (fma (floor (/ (* (fma x x -9.8596) 0.3184713375796178) (- x 3.14))) -3.14 x))))
double code(double x) { double tmp; if (x <= -2.7e-77) { tmp = fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x); } else if (x <= -2e-310) { tmp = x - (floor(pow(((((-9.8596 - (((97.21171216000002 / x) - 30.959144000000002) / x)) / x) + 3.14) / x), -1.0)) * 3.14); } else { tmp = fma(floor(((fma(x, x, -9.8596) * 0.3184713375796178) / (x - 3.14))), -3.14, x); } return tmp; }
function code(x) tmp = 0.0 if (x <= -2.7e-77) tmp = fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x); elseif (x <= -2e-310) tmp = Float64(x - Float64(floor((Float64(Float64(Float64(Float64(-9.8596 - Float64(Float64(Float64(97.21171216000002 / x) - 30.959144000000002) / x)) / x) + 3.14) / x) ^ -1.0)) * 3.14)); else tmp = fma(floor(Float64(Float64(fma(x, x, -9.8596) * 0.3184713375796178) / Float64(x - 3.14))), -3.14, x); end return tmp end
code[x_] := If[LessEqual[x, -2.7e-77], N[(N[Floor[N[(0.3184713375796178 * x + 1.0), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision], If[LessEqual[x, -2e-310], N[(x - N[(N[Floor[N[Power[N[(N[(N[(N[(-9.8596 - N[(N[(N[(97.21171216000002 / x), $MachinePrecision] - 30.959144000000002), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + 3.14), $MachinePrecision] / x), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * 3.14), $MachinePrecision]), $MachinePrecision], N[(N[Floor[N[(N[(N[(x * x + -9.8596), $MachinePrecision] * 0.3184713375796178), $MachinePrecision] / N[(x - 3.14), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{-77}:\\ \;\;\;\;\mathsf{fma}\left(\left\lfloor \mathsf{fma}\left(0.3184713375796178, x, 1\right)\right\rfloor , -3.14, x\right)\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-310}:\\ \;\;\;\;x - \left\lfloor {\left(\frac{\frac{-9.8596 - \frac{\frac{97.21171216000002}{x} - 30.959144000000002}{x}}{x} + 3.14}{x}\right)}^{-1}\right\rfloor \cdot 3.14\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left\lfloor \frac{\mathsf{fma}\left(x, x, -9.8596\right) \cdot 0.3184713375796178}{x - 3.14}\right\rfloor , -3.14, x\right)\\ \end{array} \end{array}
if x < -2.7e-77
Initial program 9.7%
lift--.f64
N/A
sub-neg
N/A
+-commutative
N/A
lift-*.f64
N/A
distribute-rgt-neg-in
N/A
lower-fma.f64
N/A
lift-/.f64
N/A
clear-num
N/A
associate-/r/
N/A
lift-+.f64
N/A
distribute-lft-in
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
10.9
Applied rewrites10.9%
if -2.7e-77 < x < -1.999999999999994e-310
Initial program 4.3%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
associate-*l/
N/A
clear-num
N/A
lower-/.f64
N/A
lower-/.f64
N/A
lower--.f64
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
4.3
Applied rewrites4.3%
Taylor expanded in x around -inf
Applied rewrites100.0%
if -1.999999999999994e-310 < x
Initial program 47.4%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
div-inv
N/A
associate-*l*
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-*.f64
N/A
inv-pow
N/A
lower-pow.f64
N/A
lower--.f64
N/A
metadata-eval
7.4
Applied rewrites7.4%
Taylor expanded in x around 0
cancel-sign-sub-inv
N/A
metadata-eval
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower-floor.f64
N/A
associate-*r/
N/A
lower-/.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
sub-neg
N/A
unpow2
N/A
metadata-eval
N/A
lower-fma.f64
N/A
lower--.f64
48.3
Applied rewrites48.3%
Final simplification50.6%
(FPCore (x) :precision binary64 (if (<= x -5.5e-103) (fma (floor (fma 0.3184713375796178 x 1.0)) -3.14 x) (if (<= x -2e-310) (- x (* (floor (pow (/ (+ (/ (- (/ 30.959144000000002 x) 9.8596) x) 3.14) x) -1.0)) 3.14)) (fma (floor (/ (* (fma x x -9.8596) 0.3184713375796178) (- x 3.14))) -3.14 x))))
double code(double x) { double tmp; if (x <= -5.5e-103) { tmp = fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x); } else if (x <= -2e-310) { tmp = x - (floor(pow((((((30.959144000000002 / x) - 9.8596) / x) + 3.14) / x), -1.0)) * 3.14); } else { tmp = fma(floor(((fma(x, x, -9.8596) * 0.3184713375796178) / (x - 3.14))), -3.14, x); } return tmp; }
function code(x) tmp = 0.0 if (x <= -5.5e-103) tmp = fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x); elseif (x <= -2e-310) tmp = Float64(x - Float64(floor((Float64(Float64(Float64(Float64(Float64(30.959144000000002 / x) - 9.8596) / x) + 3.14) / x) ^ -1.0)) * 3.14)); else tmp = fma(floor(Float64(Float64(fma(x, x, -9.8596) * 0.3184713375796178) / Float64(x - 3.14))), -3.14, x); end return tmp end
code[x_] := If[LessEqual[x, -5.5e-103], N[(N[Floor[N[(0.3184713375796178 * x + 1.0), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision], If[LessEqual[x, -2e-310], N[(x - N[(N[Floor[N[Power[N[(N[(N[(N[(N[(30.959144000000002 / x), $MachinePrecision] - 9.8596), $MachinePrecision] / x), $MachinePrecision] + 3.14), $MachinePrecision] / x), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * 3.14), $MachinePrecision]), $MachinePrecision], N[(N[Floor[N[(N[(N[(x * x + -9.8596), $MachinePrecision] * 0.3184713375796178), $MachinePrecision] / N[(x - 3.14), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-103}:\\ \;\;\;\;\mathsf{fma}\left(\left\lfloor \mathsf{fma}\left(0.3184713375796178, x, 1\right)\right\rfloor , -3.14, x\right)\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-310}:\\ \;\;\;\;x - \left\lfloor {\left(\frac{\frac{\frac{30.959144000000002}{x} - 9.8596}{x} + 3.14}{x}\right)}^{-1}\right\rfloor \cdot 3.14\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left\lfloor \frac{\mathsf{fma}\left(x, x, -9.8596\right) \cdot 0.3184713375796178}{x - 3.14}\right\rfloor , -3.14, x\right)\\ \end{array} \end{array}
if x < -5.50000000000000032e-103
Initial program 9.4%
lift--.f64
N/A
sub-neg
N/A
+-commutative
N/A
lift-*.f64
N/A
distribute-rgt-neg-in
N/A
lower-fma.f64
N/A
lift-/.f64
N/A
clear-num
N/A
associate-/r/
N/A
lift-+.f64
N/A
distribute-lft-in
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
10.5
Applied rewrites10.5%
if -5.50000000000000032e-103 < x < -1.999999999999994e-310
Initial program 4.1%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
associate-*l/
N/A
clear-num
N/A
lower-/.f64
N/A
lower-/.f64
N/A
lower--.f64
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
4.1
Applied rewrites4.1%
Taylor expanded in x around inf
lower-/.f64
N/A
associate--l+
N/A
+-commutative
N/A
unpow2
N/A
associate-/r*
N/A
metadata-eval
N/A
associate-*r/
N/A
associate-*r/
N/A
metadata-eval
N/A
div-sub
N/A
lower-+.f64
N/A
lower-/.f64
N/A
lower--.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
100.0
Applied rewrites100.0%
if -1.999999999999994e-310 < x
Initial program 47.4%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
div-inv
N/A
associate-*l*
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-*.f64
N/A
inv-pow
N/A
lower-pow.f64
N/A
lower--.f64
N/A
metadata-eval
7.4
Applied rewrites7.4%
Taylor expanded in x around 0
cancel-sign-sub-inv
N/A
metadata-eval
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower-floor.f64
N/A
associate-*r/
N/A
lower-/.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
sub-neg
N/A
unpow2
N/A
metadata-eval
N/A
lower-fma.f64
N/A
lower--.f64
48.3
Applied rewrites48.3%
Final simplification48.4%
(FPCore (x) :precision binary64 (if (<= x -2.4e-154) (fma (floor (fma 0.3184713375796178 x 1.0)) -3.14 x) (if (<= x -2e-310) (- x (* (floor (pow (/ (- 3.14 (/ 9.8596 x)) x) -1.0)) 3.14)) (fma (floor (/ (* (fma x x -9.8596) 0.3184713375796178) (- x 3.14))) -3.14 x))))
double code(double x) { double tmp; if (x <= -2.4e-154) { tmp = fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x); } else if (x <= -2e-310) { tmp = x - (floor(pow(((3.14 - (9.8596 / x)) / x), -1.0)) * 3.14); } else { tmp = fma(floor(((fma(x, x, -9.8596) * 0.3184713375796178) / (x - 3.14))), -3.14, x); } return tmp; }
function code(x) tmp = 0.0 if (x <= -2.4e-154) tmp = fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x); elseif (x <= -2e-310) tmp = Float64(x - Float64(floor((Float64(Float64(3.14 - Float64(9.8596 / x)) / x) ^ -1.0)) * 3.14)); else tmp = fma(floor(Float64(Float64(fma(x, x, -9.8596) * 0.3184713375796178) / Float64(x - 3.14))), -3.14, x); end return tmp end
code[x_] := If[LessEqual[x, -2.4e-154], N[(N[Floor[N[(0.3184713375796178 * x + 1.0), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision], If[LessEqual[x, -2e-310], N[(x - N[(N[Floor[N[Power[N[(N[(3.14 - N[(9.8596 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * 3.14), $MachinePrecision]), $MachinePrecision], N[(N[Floor[N[(N[(N[(x * x + -9.8596), $MachinePrecision] * 0.3184713375796178), $MachinePrecision] / N[(x - 3.14), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-154}:\\ \;\;\;\;\mathsf{fma}\left(\left\lfloor \mathsf{fma}\left(0.3184713375796178, x, 1\right)\right\rfloor , -3.14, x\right)\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-310}:\\ \;\;\;\;x - \left\lfloor {\left(\frac{3.14 - \frac{9.8596}{x}}{x}\right)}^{-1}\right\rfloor \cdot 3.14\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left\lfloor \frac{\mathsf{fma}\left(x, x, -9.8596\right) \cdot 0.3184713375796178}{x - 3.14}\right\rfloor , -3.14, x\right)\\ \end{array} \end{array}
if x < -2.39999999999999987e-154
Initial program 8.8%
lift--.f64
N/A
sub-neg
N/A
+-commutative
N/A
lift-*.f64
N/A
distribute-rgt-neg-in
N/A
lower-fma.f64
N/A
lift-/.f64
N/A
clear-num
N/A
associate-/r/
N/A
lift-+.f64
N/A
distribute-lft-in
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
9.8
Applied rewrites9.8%
if -2.39999999999999987e-154 < x < -1.999999999999994e-310
Initial program 3.9%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
associate-*l/
N/A
clear-num
N/A
lower-/.f64
N/A
lower-/.f64
N/A
lower--.f64
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
3.9
Applied rewrites3.9%
Taylor expanded in x around inf
lower-/.f64
N/A
lower--.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
100.0
Applied rewrites100.0%
if -1.999999999999994e-310 < x
Initial program 47.4%
lift-/.f64
N/A
div-inv
N/A
lift-+.f64
N/A
flip-+
N/A
div-inv
N/A
associate-*l*
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-*.f64
N/A
inv-pow
N/A
lower-pow.f64
N/A
lower--.f64
N/A
metadata-eval
7.4
Applied rewrites7.4%
Taylor expanded in x around 0
cancel-sign-sub-inv
N/A
metadata-eval
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower-floor.f64
N/A
associate-*r/
N/A
lower-/.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
sub-neg
N/A
unpow2
N/A
metadata-eval
N/A
lower-fma.f64
N/A
lower--.f64
48.3
Applied rewrites48.3%
Final simplification44.7%
(FPCore (x) :precision binary64 (fma (floor (fma 0.3184713375796178 x 1.0)) -3.14 x))
double code(double x) { return fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x); }
function code(x) return fma(floor(fma(0.3184713375796178, x, 1.0)), -3.14, x) end
code[x_] := N[(N[Floor[N[(0.3184713375796178 * x + 1.0), $MachinePrecision]], $MachinePrecision] * -3.14 + x), $MachinePrecision]
\begin{array}{l} \\ \mathsf{fma}\left(\left\lfloor \mathsf{fma}\left(0.3184713375796178, x, 1\right)\right\rfloor , -3.14, x\right) \end{array}
Initial program 27.4%
lift--.f64
N/A
sub-neg
N/A
+-commutative
N/A
lift-*.f64
N/A
distribute-rgt-neg-in
N/A
lower-fma.f64
N/A
lift-/.f64
N/A
clear-num
N/A
associate-/r/
N/A
lift-+.f64
N/A
distribute-lft-in
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
28.1
Applied rewrites28.1%
(FPCore (x) :precision binary64 (fma (floor 1.0) -3.14 x))
double code(double x) { return fma(floor(1.0), -3.14, x); }
function code(x) return fma(floor(1.0), -3.14, x) end
code[x_] := N[(N[Floor[1.0], $MachinePrecision] * -3.14 + x), $MachinePrecision]
\begin{array}{l} \\ \mathsf{fma}\left(\left\lfloor 1\right\rfloor , -3.14, x\right) \end{array}
Initial program 27.4%
Taylor expanded in x around 0
Applied rewrites25.0%
lift--.f64
N/A
sub-neg
N/A
+-commutative
N/A
lift-*.f64
N/A
distribute-rgt-neg-in
N/A
lower-fma.f64
N/A
metadata-eval
25.0
Applied rewrites25.0%
herbie shell --seed 1
(FPCore (x)
:name "x - floor((x+3.14)/3.14)*3.14"
:precision binary64
:pre (and (<= -1.79e+308 x) (<= x 1.79e+308))
(- x (* (floor (/ (+ x 3.14) 3.14)) 3.14)))