
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = mod(exp(x), sqrt(cos(x))) * exp(-x)
end function
def code(x): return math.fmod(math.exp(x), math.sqrt(math.cos(x))) * math.exp(-x)
function code(x) return Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x))) end
code[x_] := N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = mod(exp(x), sqrt(cos(x))) * exp(-x)
end function
def code(x): return math.fmod(math.exp(x), math.sqrt(math.cos(x))) * math.exp(-x)
function code(x) return Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x))) end
code[x_] := N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (- (pow x -2.0) 0.25)) (t_1 (exp (- x))))
(if (<= x -5e-32)
(* (fmod (exp x) (* t_0 (* x x))) (/ 1.0 (exp x)))
(if (<= x -7.5e-155)
(*
(fmod
1.0
(* (/ (- (pow x -4.0) 0.0625) (- (pow x -2.0) -0.25)) (* x x)))
t_1)
(if (<= x -2e-310)
(* (fmod 1.0 (* (* t_0 x) x)) t_1)
(* (fmod x (fma (* x x) -0.25 1.0)) t_1))))))
double code(double x) {
double t_0 = pow(x, -2.0) - 0.25;
double t_1 = exp(-x);
double tmp;
if (x <= -5e-32) {
tmp = fmod(exp(x), (t_0 * (x * x))) * (1.0 / exp(x));
} else if (x <= -7.5e-155) {
tmp = fmod(1.0, (((pow(x, -4.0) - 0.0625) / (pow(x, -2.0) - -0.25)) * (x * x))) * t_1;
} else if (x <= -2e-310) {
tmp = fmod(1.0, ((t_0 * x) * x)) * t_1;
} else {
tmp = fmod(x, fma((x * x), -0.25, 1.0)) * t_1;
}
return tmp;
}
function code(x) t_0 = Float64((x ^ -2.0) - 0.25) t_1 = exp(Float64(-x)) tmp = 0.0 if (x <= -5e-32) tmp = Float64(rem(exp(x), Float64(t_0 * Float64(x * x))) * Float64(1.0 / exp(x))); elseif (x <= -7.5e-155) tmp = Float64(rem(1.0, Float64(Float64(Float64((x ^ -4.0) - 0.0625) / Float64((x ^ -2.0) - -0.25)) * Float64(x * x))) * t_1); elseif (x <= -2e-310) tmp = Float64(rem(1.0, Float64(Float64(t_0 * x) * x)) * t_1); else tmp = Float64(rem(x, fma(Float64(x * x), -0.25, 1.0)) * t_1); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[x, -2.0], $MachinePrecision] - 0.25), $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -5e-32], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(t$95$0 * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(1.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-155], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(N[Power[x, -4.0], $MachinePrecision] - 0.0625), $MachinePrecision] / N[(N[Power[x, -2.0], $MachinePrecision] - -0.25), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x, -2e-310], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(t$95$0 * x), $MachinePrecision] * x), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{-2} - 0.25\\
t_1 := e^{-x}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-32}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(t\_0 \cdot \left(x \cdot x\right)\right)\right) \cdot \frac{1}{e^{x}}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-155}:\\
\;\;\;\;\left(1 \bmod \left(\frac{{x}^{-4} - 0.0625}{{x}^{-2} - -0.25} \cdot \left(x \cdot x\right)\right)\right) \cdot t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(1 \bmod \left(\left(t\_0 \cdot x\right) \cdot x\right)\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod \left(\mathsf{fma}\left(x \cdot x, -0.25, 1\right)\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if x < -5e-32Initial program 46.5%
lift-neg.f64N/A
lift-exp.f64N/A
exp-negN/A
lower-/.f64N/A
lift-exp.f6446.6
Applied rewrites46.6%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f6450.0
Applied rewrites50.0%
if -5e-32 < x < -7.5000000000000006e-155Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f649.0
Applied rewrites9.0%
lift--.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-flipN/A
flip--N/A
lower-/.f64N/A
frac-timesN/A
metadata-evalN/A
pow-prod-upN/A
metadata-evalN/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
lower--.f64N/A
pow-flipN/A
metadata-evalN/A
lift-pow.f6470.0
Applied rewrites70.0%
if -7.5000000000000006e-155 < x < -1.999999999999994e-310Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f645.4
Applied rewrites5.4%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift--.f64100.0
Applied rewrites100.0%
if -1.999999999999994e-310 < x Initial program 6.0%
Taylor expanded in x around 0
Applied rewrites36.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6436.5
Applied rewrites36.5%
Taylor expanded in x around 0
lower-+.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
Applied rewrites98.1%
(FPCore (x) :precision binary64 (if (<= (* (fmod (exp x) (sqrt (cos x))) (exp (- x))) 2.0) (* (fmod (exp x) 1.0) (- 1.0 x)) (* (fmod 1.0 1.0) (fma -1.0 x 1.0))))
double code(double x) {
double tmp;
if ((fmod(exp(x), sqrt(cos(x))) * exp(-x)) <= 2.0) {
tmp = fmod(exp(x), 1.0) * (1.0 - x);
} else {
tmp = fmod(1.0, 1.0) * fma(-1.0, x, 1.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x))) <= 2.0) tmp = Float64(rem(exp(x), 1.0) * Float64(1.0 - x)); else tmp = Float64(rem(1.0, 1.0) * fma(-1.0, x, 1.0)); end return tmp end
code[x_] := If[LessEqual[N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision], 2.0], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], N[(N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(-1.0 * x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x} \leq 2:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod 1\right) \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right) \cdot \mathsf{fma}\left(-1, x, 1\right)\\
\end{array}
\end{array}
if (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) < 2Initial program 8.7%
Taylor expanded in x around 0
Applied rewrites7.9%
Taylor expanded in x around 0
rec-expN/A
mul-1-negN/A
flip-+N/A
sqr-neg-revN/A
flip3--N/A
metadata-evalN/A
cube-negN/A
sqr-powN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
sqr-powN/A
sqr-neg-revN/A
unpow2N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
fp-cancel-sub-sign-invN/A
unpow2N/A
Applied rewrites7.2%
if 2 < (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) Initial program 0.0%
Taylor expanded in x around 0
Applied rewrites97.9%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6497.9
Applied rewrites97.9%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
lower-fma.f642.5
Applied rewrites2.5%
Taylor expanded in x around 0
Applied rewrites97.9%
(FPCore (x)
:precision binary64
(let* ((t_0 (fma (* x x) -0.25 1.0)) (t_1 (exp (- x))))
(if (<= x -6e-17)
(/ (* (fmod (exp x) t_0) 1.0) (exp x))
(if (<= x -1e-154)
(* (fmod 1.0 (* (- (exp (* (log (* x x)) -1.0)) 0.25) (* x x))) t_1)
(if (<= x -2e-310)
(* (fmod 1.0 (* (* (- (pow x -2.0) 0.25) x) x)) t_1)
(* (fmod x t_0) t_1))))))
double code(double x) {
double t_0 = fma((x * x), -0.25, 1.0);
double t_1 = exp(-x);
double tmp;
if (x <= -6e-17) {
tmp = (fmod(exp(x), t_0) * 1.0) / exp(x);
} else if (x <= -1e-154) {
tmp = fmod(1.0, ((exp((log((x * x)) * -1.0)) - 0.25) * (x * x))) * t_1;
} else if (x <= -2e-310) {
tmp = fmod(1.0, (((pow(x, -2.0) - 0.25) * x) * x)) * t_1;
} else {
tmp = fmod(x, t_0) * t_1;
}
return tmp;
}
function code(x) t_0 = fma(Float64(x * x), -0.25, 1.0) t_1 = exp(Float64(-x)) tmp = 0.0 if (x <= -6e-17) tmp = Float64(Float64(rem(exp(x), t_0) * 1.0) / exp(x)); elseif (x <= -1e-154) tmp = Float64(rem(1.0, Float64(Float64(exp(Float64(log(Float64(x * x)) * -1.0)) - 0.25) * Float64(x * x))) * t_1); elseif (x <= -2e-310) tmp = Float64(rem(1.0, Float64(Float64(Float64((x ^ -2.0) - 0.25) * x) * x)) * t_1); else tmp = Float64(rem(x, t_0) * t_1); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -6e-17], N[(N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = t$95$0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-154], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[Exp[N[(N[Log[N[(x * x), $MachinePrecision]], $MachinePrecision] * -1.0), $MachinePrecision]], $MachinePrecision] - 0.25), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x, -2e-310], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(N[Power[x, -2.0], $MachinePrecision] - 0.25), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = t$95$0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x \cdot x, -0.25, 1\right)\\
t_1 := e^{-x}\\
\mathbf{if}\;x \leq -6 \cdot 10^{-17}:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod t\_0\right) \cdot 1}{e^{x}}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-154}:\\
\;\;\;\;\left(1 \bmod \left(\left(e^{\log \left(x \cdot x\right) \cdot -1} - 0.25\right) \cdot \left(x \cdot x\right)\right)\right) \cdot t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(1 \bmod \left(\left(\left({x}^{-2} - 0.25\right) \cdot x\right) \cdot x\right)\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod t\_0\right) \cdot t\_1\\
\end{array}
\end{array}
if x < -6.00000000000000012e-17Initial program 83.5%
lift-neg.f64N/A
lift-exp.f64N/A
exp-negN/A
lower-/.f64N/A
lift-exp.f6483.8
Applied rewrites83.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.8
Applied rewrites83.8%
lift-*.f64N/A
lift-/.f64N/A
lift-exp.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-exp.f6484.0
Applied rewrites84.0%
if -6.00000000000000012e-17 < x < -9.9999999999999997e-155Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f649.3
Applied rewrites9.3%
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
lift-*.f6455.7
Applied rewrites55.7%
if -9.9999999999999997e-155 < x < -1.999999999999994e-310Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f645.4
Applied rewrites5.4%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift--.f6499.8
Applied rewrites99.8%
if -1.999999999999994e-310 < x Initial program 6.0%
Taylor expanded in x around 0
Applied rewrites36.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6436.5
Applied rewrites36.5%
Taylor expanded in x around 0
lower-+.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
Applied rewrites98.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (exp (- x))) (t_1 (fma (* x x) -0.25 1.0)))
(if (<= x -5e-17)
(/ (* (fmod (exp x) t_1) 1.0) (exp x))
(if (<= x -2e-151)
(* (fmod 1.0 (* (fma (/ -1.0 x) (/ -1.0 x) -0.25) (* x x))) t_0)
(if (<= x -2e-310)
(* (fmod 1.0 (* (* (- (pow x -2.0) 0.25) x) x)) t_0)
(* (fmod x t_1) t_0))))))
double code(double x) {
double t_0 = exp(-x);
double t_1 = fma((x * x), -0.25, 1.0);
double tmp;
if (x <= -5e-17) {
tmp = (fmod(exp(x), t_1) * 1.0) / exp(x);
} else if (x <= -2e-151) {
tmp = fmod(1.0, (fma((-1.0 / x), (-1.0 / x), -0.25) * (x * x))) * t_0;
} else if (x <= -2e-310) {
tmp = fmod(1.0, (((pow(x, -2.0) - 0.25) * x) * x)) * t_0;
} else {
tmp = fmod(x, t_1) * t_0;
}
return tmp;
}
function code(x) t_0 = exp(Float64(-x)) t_1 = fma(Float64(x * x), -0.25, 1.0) tmp = 0.0 if (x <= -5e-17) tmp = Float64(Float64(rem(exp(x), t_1) * 1.0) / exp(x)); elseif (x <= -2e-151) tmp = Float64(rem(1.0, Float64(fma(Float64(-1.0 / x), Float64(-1.0 / x), -0.25) * Float64(x * x))) * t_0); elseif (x <= -2e-310) tmp = Float64(rem(1.0, Float64(Float64(Float64((x ^ -2.0) - 0.25) * x) * x)) * t_0); else tmp = Float64(rem(x, t_1) * t_0); end return tmp end
code[x_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, If[LessEqual[x, -5e-17], N[(N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = t$95$1}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-151], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(-1.0 / x), $MachinePrecision] * N[(-1.0 / x), $MachinePrecision] + -0.25), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -2e-310], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(N[Power[x, -2.0], $MachinePrecision] - 0.25), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = t$95$1}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-x}\\
t_1 := \mathsf{fma}\left(x \cdot x, -0.25, 1\right)\\
\mathbf{if}\;x \leq -5 \cdot 10^{-17}:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod t\_1\right) \cdot 1}{e^{x}}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-151}:\\
\;\;\;\;\left(1 \bmod \left(\mathsf{fma}\left(\frac{-1}{x}, \frac{-1}{x}, -0.25\right) \cdot \left(x \cdot x\right)\right)\right) \cdot t\_0\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(1 \bmod \left(\left(\left({x}^{-2} - 0.25\right) \cdot x\right) \cdot x\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod t\_1\right) \cdot t\_0\\
\end{array}
\end{array}
if x < -4.9999999999999999e-17Initial program 83.5%
lift-neg.f64N/A
lift-exp.f64N/A
exp-negN/A
lower-/.f64N/A
lift-exp.f6483.8
Applied rewrites83.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.8
Applied rewrites83.8%
lift-*.f64N/A
lift-/.f64N/A
lift-exp.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-exp.f6484.0
Applied rewrites84.0%
if -4.9999999999999999e-17 < x < -1.9999999999999999e-151Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f649.2
Applied rewrites9.2%
lift--.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-flipN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
pow2N/A
times-fracN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6422.8
Applied rewrites22.8%
if -1.9999999999999999e-151 < x < -1.999999999999994e-310Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f645.6
Applied rewrites5.6%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift--.f6497.8
Applied rewrites97.8%
if -1.999999999999994e-310 < x Initial program 6.0%
Taylor expanded in x around 0
Applied rewrites36.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6436.5
Applied rewrites36.5%
Taylor expanded in x around 0
lower-+.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
Applied rewrites98.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (exp (- x))))
(if (<= x -5e-17)
(* (fmod (exp x) 1.0) (/ 1.0 (exp x)))
(if (<= x -2e-151)
(* (fmod 1.0 (* (fma (/ -1.0 x) (/ -1.0 x) -0.25) (* x x))) t_0)
(if (<= x -2e-310)
(* (fmod 1.0 (* (* (- (pow x -2.0) 0.25) x) x)) t_0)
(* (fmod x (fma (* x x) -0.25 1.0)) t_0))))))
double code(double x) {
double t_0 = exp(-x);
double tmp;
if (x <= -5e-17) {
tmp = fmod(exp(x), 1.0) * (1.0 / exp(x));
} else if (x <= -2e-151) {
tmp = fmod(1.0, (fma((-1.0 / x), (-1.0 / x), -0.25) * (x * x))) * t_0;
} else if (x <= -2e-310) {
tmp = fmod(1.0, (((pow(x, -2.0) - 0.25) * x) * x)) * t_0;
} else {
tmp = fmod(x, fma((x * x), -0.25, 1.0)) * t_0;
}
return tmp;
}
function code(x) t_0 = exp(Float64(-x)) tmp = 0.0 if (x <= -5e-17) tmp = Float64(rem(exp(x), 1.0) * Float64(1.0 / exp(x))); elseif (x <= -2e-151) tmp = Float64(rem(1.0, Float64(fma(Float64(-1.0 / x), Float64(-1.0 / x), -0.25) * Float64(x * x))) * t_0); elseif (x <= -2e-310) tmp = Float64(rem(1.0, Float64(Float64(Float64((x ^ -2.0) - 0.25) * x) * x)) * t_0); else tmp = Float64(rem(x, fma(Float64(x * x), -0.25, 1.0)) * t_0); end return tmp end
code[x_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -5e-17], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(1.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-151], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(-1.0 / x), $MachinePrecision] * N[(-1.0 / x), $MachinePrecision] + -0.25), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -2e-310], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(N[Power[x, -2.0], $MachinePrecision] - 0.25), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-17}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod 1\right) \cdot \frac{1}{e^{x}}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-151}:\\
\;\;\;\;\left(1 \bmod \left(\mathsf{fma}\left(\frac{-1}{x}, \frac{-1}{x}, -0.25\right) \cdot \left(x \cdot x\right)\right)\right) \cdot t\_0\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(1 \bmod \left(\left(\left({x}^{-2} - 0.25\right) \cdot x\right) \cdot x\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod \left(\mathsf{fma}\left(x \cdot x, -0.25, 1\right)\right)\right) \cdot t\_0\\
\end{array}
\end{array}
if x < -4.9999999999999999e-17Initial program 83.5%
Taylor expanded in x around 0
Applied rewrites83.5%
lift-neg.f64N/A
lift-exp.f64N/A
rec-expN/A
lift-exp.f64N/A
lift-/.f6483.8
Applied rewrites83.8%
if -4.9999999999999999e-17 < x < -1.9999999999999999e-151Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f649.2
Applied rewrites9.2%
lift--.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-flipN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
pow2N/A
times-fracN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6422.8
Applied rewrites22.8%
if -1.9999999999999999e-151 < x < -1.999999999999994e-310Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f645.6
Applied rewrites5.6%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift--.f6497.8
Applied rewrites97.8%
if -1.999999999999994e-310 < x Initial program 6.0%
Taylor expanded in x around 0
Applied rewrites36.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6436.5
Applied rewrites36.5%
Taylor expanded in x around 0
lower-+.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
Applied rewrites98.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (exp (- x))))
(if (<= x -5e-17)
(* (fmod (exp x) 1.0) (/ 1.0 (exp x)))
(if (<= x -1.55e-162)
(* (fmod 1.0 (* (fma (/ -1.0 x) (/ -1.0 x) -0.25) (* x x))) t_0)
(* (fmod x (fma (* x x) -0.25 1.0)) t_0)))))
double code(double x) {
double t_0 = exp(-x);
double tmp;
if (x <= -5e-17) {
tmp = fmod(exp(x), 1.0) * (1.0 / exp(x));
} else if (x <= -1.55e-162) {
tmp = fmod(1.0, (fma((-1.0 / x), (-1.0 / x), -0.25) * (x * x))) * t_0;
} else {
tmp = fmod(x, fma((x * x), -0.25, 1.0)) * t_0;
}
return tmp;
}
function code(x) t_0 = exp(Float64(-x)) tmp = 0.0 if (x <= -5e-17) tmp = Float64(rem(exp(x), 1.0) * Float64(1.0 / exp(x))); elseif (x <= -1.55e-162) tmp = Float64(rem(1.0, Float64(fma(Float64(-1.0 / x), Float64(-1.0 / x), -0.25) * Float64(x * x))) * t_0); else tmp = Float64(rem(x, fma(Float64(x * x), -0.25, 1.0)) * t_0); end return tmp end
code[x_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -5e-17], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(1.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.55e-162], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(-1.0 / x), $MachinePrecision] * N[(-1.0 / x), $MachinePrecision] + -0.25), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-17}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod 1\right) \cdot \frac{1}{e^{x}}\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-162}:\\
\;\;\;\;\left(1 \bmod \left(\mathsf{fma}\left(\frac{-1}{x}, \frac{-1}{x}, -0.25\right) \cdot \left(x \cdot x\right)\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod \left(\mathsf{fma}\left(x \cdot x, -0.25, 1\right)\right)\right) \cdot t\_0\\
\end{array}
\end{array}
if x < -4.9999999999999999e-17Initial program 83.5%
Taylor expanded in x around 0
Applied rewrites83.5%
lift-neg.f64N/A
lift-exp.f64N/A
rec-expN/A
lift-exp.f64N/A
lift-/.f6483.8
Applied rewrites83.8%
if -4.9999999999999999e-17 < x < -1.5499999999999999e-162Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f6414.4
Applied rewrites14.4%
lift--.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-flipN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
pow2N/A
times-fracN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6427.2
Applied rewrites27.2%
if -1.5499999999999999e-162 < x Initial program 5.3%
Taylor expanded in x around 0
Applied rewrites28.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6428.5
Applied rewrites28.5%
Taylor expanded in x around 0
lower-+.f6429.3
Applied rewrites29.3%
Taylor expanded in x around inf
Applied rewrites75.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (fma (* x x) -0.25 1.0)) (t_1 (exp (- x))))
(if (<= x -5e-17)
(* (fmod (fma (fma 0.5 x 1.0) x 1.0) t_0) t_1)
(if (<= x -1.55e-162)
(* (fmod 1.0 (* (fma (/ -1.0 x) (/ -1.0 x) -0.25) (* x x))) t_1)
(* (fmod x t_0) t_1)))))
double code(double x) {
double t_0 = fma((x * x), -0.25, 1.0);
double t_1 = exp(-x);
double tmp;
if (x <= -5e-17) {
tmp = fmod(fma(fma(0.5, x, 1.0), x, 1.0), t_0) * t_1;
} else if (x <= -1.55e-162) {
tmp = fmod(1.0, (fma((-1.0 / x), (-1.0 / x), -0.25) * (x * x))) * t_1;
} else {
tmp = fmod(x, t_0) * t_1;
}
return tmp;
}
function code(x) t_0 = fma(Float64(x * x), -0.25, 1.0) t_1 = exp(Float64(-x)) tmp = 0.0 if (x <= -5e-17) tmp = Float64(rem(fma(fma(0.5, x, 1.0), x, 1.0), t_0) * t_1); elseif (x <= -1.55e-162) tmp = Float64(rem(1.0, Float64(fma(Float64(-1.0 / x), Float64(-1.0 / x), -0.25) * Float64(x * x))) * t_1); else tmp = Float64(rem(x, t_0) * t_1); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -5e-17], N[(N[With[{TMP1 = N[(N[(0.5 * x + 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision], TMP2 = t$95$0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x, -1.55e-162], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[(-1.0 / x), $MachinePrecision] * N[(-1.0 / x), $MachinePrecision] + -0.25), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = t$95$0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x \cdot x, -0.25, 1\right)\\
t_1 := e^{-x}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-17}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\right)\right) \bmod t\_0\right) \cdot t\_1\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-162}:\\
\;\;\;\;\left(1 \bmod \left(\mathsf{fma}\left(\frac{-1}{x}, \frac{-1}{x}, -0.25\right) \cdot \left(x \cdot x\right)\right)\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod t\_0\right) \cdot t\_1\\
\end{array}
\end{array}
if x < -4.9999999999999999e-17Initial program 83.5%
Taylor expanded in x around 0
Applied rewrites6.6%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f646.5
Applied rewrites6.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6469.1
Applied rewrites69.1%
if -4.9999999999999999e-17 < x < -1.5499999999999999e-162Initial program 3.1%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f6414.4
Applied rewrites14.4%
lift--.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-flipN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
pow2N/A
times-fracN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6427.2
Applied rewrites27.2%
if -1.5499999999999999e-162 < x Initial program 5.3%
Taylor expanded in x around 0
Applied rewrites28.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6428.5
Applied rewrites28.5%
Taylor expanded in x around 0
lower-+.f6429.3
Applied rewrites29.3%
Taylor expanded in x around inf
Applied rewrites75.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (fma (* x x) -0.25 1.0)) (t_1 (exp (- x))))
(if (<= x -1e-10)
(* (fmod (fma (fma 0.5 x 1.0) x 1.0) t_0) t_1)
(if (<= x -1.55e-162)
(* (fmod 1.0 (* (- (pow x -2.0) 0.25) (* x x))) 1.0)
(* (fmod x t_0) t_1)))))
double code(double x) {
double t_0 = fma((x * x), -0.25, 1.0);
double t_1 = exp(-x);
double tmp;
if (x <= -1e-10) {
tmp = fmod(fma(fma(0.5, x, 1.0), x, 1.0), t_0) * t_1;
} else if (x <= -1.55e-162) {
tmp = fmod(1.0, ((pow(x, -2.0) - 0.25) * (x * x))) * 1.0;
} else {
tmp = fmod(x, t_0) * t_1;
}
return tmp;
}
function code(x) t_0 = fma(Float64(x * x), -0.25, 1.0) t_1 = exp(Float64(-x)) tmp = 0.0 if (x <= -1e-10) tmp = Float64(rem(fma(fma(0.5, x, 1.0), x, 1.0), t_0) * t_1); elseif (x <= -1.55e-162) tmp = Float64(rem(1.0, Float64(Float64((x ^ -2.0) - 0.25) * Float64(x * x))) * 1.0); else tmp = Float64(rem(x, t_0) * t_1); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -1e-10], N[(N[With[{TMP1 = N[(N[(0.5 * x + 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision], TMP2 = t$95$0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x, -1.55e-162], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[Power[x, -2.0], $MachinePrecision] - 0.25), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = t$95$0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x \cdot x, -0.25, 1\right)\\
t_1 := e^{-x}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\right)\right) \bmod t\_0\right) \cdot t\_1\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-162}:\\
\;\;\;\;\left(1 \bmod \left(\left({x}^{-2} - 0.25\right) \cdot \left(x \cdot x\right)\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod t\_0\right) \cdot t\_1\\
\end{array}
\end{array}
if x < -1.00000000000000004e-10Initial program 74.6%
Taylor expanded in x around 0
Applied rewrites8.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f648.4
Applied rewrites8.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6452.1
Applied rewrites52.1%
if -1.00000000000000004e-10 < x < -1.5499999999999999e-162Initial program 7.6%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f6414.0
Applied rewrites14.0%
Taylor expanded in x around 0
rec-exp14.0
Applied rewrites14.0%
if -1.5499999999999999e-162 < x Initial program 5.3%
Taylor expanded in x around 0
Applied rewrites28.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6428.5
Applied rewrites28.5%
Taylor expanded in x around 0
lower-+.f6429.3
Applied rewrites29.3%
Taylor expanded in x around inf
Applied rewrites75.2%
(FPCore (x)
:precision binary64
(if (<= x -1e-10)
(* (fmod (exp x) 1.0) (fma (fma 0.5 x -1.0) x 1.0))
(if (<= x -1.55e-162)
(* (fmod 1.0 (* (- (pow x -2.0) 0.25) (* x x))) 1.0)
(* (fmod x (fma (* x x) -0.25 1.0)) (exp (- x))))))
double code(double x) {
double tmp;
if (x <= -1e-10) {
tmp = fmod(exp(x), 1.0) * fma(fma(0.5, x, -1.0), x, 1.0);
} else if (x <= -1.55e-162) {
tmp = fmod(1.0, ((pow(x, -2.0) - 0.25) * (x * x))) * 1.0;
} else {
tmp = fmod(x, fma((x * x), -0.25, 1.0)) * exp(-x);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= -1e-10) tmp = Float64(rem(exp(x), 1.0) * fma(fma(0.5, x, -1.0), x, 1.0)); elseif (x <= -1.55e-162) tmp = Float64(rem(1.0, Float64(Float64((x ^ -2.0) - 0.25) * Float64(x * x))) * 1.0); else tmp = Float64(rem(x, fma(Float64(x * x), -0.25, 1.0)) * exp(Float64(-x))); end return tmp end
code[x_] := If[LessEqual[x, -1e-10], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(N[(0.5 * x + -1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.55e-162], N[(N[With[{TMP1 = 1.0, TMP2 = N[(N[(N[Power[x, -2.0], $MachinePrecision] - 0.25), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, -1\right), x, 1\right)\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-162}:\\
\;\;\;\;\left(1 \bmod \left(\left({x}^{-2} - 0.25\right) \cdot \left(x \cdot x\right)\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod \left(\mathsf{fma}\left(x \cdot x, -0.25, 1\right)\right)\right) \cdot e^{-x}\\
\end{array}
\end{array}
if x < -1.00000000000000004e-10Initial program 74.6%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f6451.7
Applied rewrites51.7%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6451.7
Applied rewrites51.7%
Taylor expanded in x around 0
Applied rewrites51.7%
if -1.00000000000000004e-10 < x < -1.5499999999999999e-162Initial program 7.6%
Taylor expanded in x around 0
Applied rewrites3.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-evalN/A
pow2N/A
lift-*.f6414.0
Applied rewrites14.0%
Taylor expanded in x around 0
rec-exp14.0
Applied rewrites14.0%
if -1.5499999999999999e-162 < x Initial program 5.3%
Taylor expanded in x around 0
Applied rewrites28.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6428.5
Applied rewrites28.5%
Taylor expanded in x around 0
lower-+.f6429.3
Applied rewrites29.3%
Taylor expanded in x around inf
Applied rewrites75.2%
(FPCore (x) :precision binary64 (if (<= x -2e-310) (* (fmod (exp x) 1.0) (fma (fma 0.5 x -1.0) x 1.0)) (* (fmod x (fma (* x x) -0.25 1.0)) (exp (- x)))))
double code(double x) {
double tmp;
if (x <= -2e-310) {
tmp = fmod(exp(x), 1.0) * fma(fma(0.5, x, -1.0), x, 1.0);
} else {
tmp = fmod(x, fma((x * x), -0.25, 1.0)) * exp(-x);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= -2e-310) tmp = Float64(rem(exp(x), 1.0) * fma(fma(0.5, x, -1.0), x, 1.0)); else tmp = Float64(rem(x, fma(Float64(x * x), -0.25, 1.0)) * exp(Float64(-x))); end return tmp end
code[x_] := If[LessEqual[x, -2e-310], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(N[(0.5 * x + -1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[With[{TMP1 = x, TMP2 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod 1\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, -1\right), x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \bmod \left(\mathsf{fma}\left(x \cdot x, -0.25, 1\right)\right)\right) \cdot e^{-x}\\
\end{array}
\end{array}
if x < -1.999999999999994e-310Initial program 8.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f647.4
Applied rewrites7.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f647.4
Applied rewrites7.4%
Taylor expanded in x around 0
Applied rewrites7.4%
if -1.999999999999994e-310 < x Initial program 6.0%
Taylor expanded in x around 0
Applied rewrites36.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6436.5
Applied rewrites36.5%
Taylor expanded in x around 0
lower-+.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
Applied rewrites98.1%
(FPCore (x) :precision binary64 (* (fmod (+ 1.0 x) 1.0) (exp (- x))))
double code(double x) {
return fmod((1.0 + x), 1.0) * exp(-x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = mod((1.0d0 + x), 1.0d0) * exp(-x)
end function
def code(x): return math.fmod((1.0 + x), 1.0) * math.exp(-x)
function code(x) return Float64(rem(Float64(1.0 + x), 1.0) * exp(Float64(-x))) end
code[x_] := N[(N[With[{TMP1 = N[(1.0 + x), $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(1 + x\right) \bmod 1\right) \cdot e^{-x}
\end{array}
Initial program 7.0%
Taylor expanded in x around 0
Applied rewrites23.0%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6423.0
Applied rewrites23.0%
Taylor expanded in x around 0
lower-+.f6425.1
Applied rewrites25.1%
Taylor expanded in x around 0
Applied rewrites25.1%
(FPCore (x)
:precision binary64
(if (<= x 0.01)
(*
(fmod (+ 1.0 x) (fma (* x x) -0.25 1.0))
(fma (fma (fma -0.16666666666666666 x 0.5) x -1.0) x 1.0))
(* (fmod 1.0 1.0) (fma -1.0 x 1.0))))
double code(double x) {
double tmp;
if (x <= 0.01) {
tmp = fmod((1.0 + x), fma((x * x), -0.25, 1.0)) * fma(fma(fma(-0.16666666666666666, x, 0.5), x, -1.0), x, 1.0);
} else {
tmp = fmod(1.0, 1.0) * fma(-1.0, x, 1.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 0.01) tmp = Float64(rem(Float64(1.0 + x), fma(Float64(x * x), -0.25, 1.0)) * fma(fma(fma(-0.16666666666666666, x, 0.5), x, -1.0), x, 1.0)); else tmp = Float64(rem(1.0, 1.0) * fma(-1.0, x, 1.0)); end return tmp end
code[x_] := If[LessEqual[x, 0.01], N[(N[With[{TMP1 = N[(1.0 + x), $MachinePrecision], TMP2 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(N[(N[(-0.16666666666666666 * x + 0.5), $MachinePrecision] * x + -1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(-1.0 * x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.01:\\
\;\;\;\;\left(\left(1 + x\right) \bmod \left(\mathsf{fma}\left(x \cdot x, -0.25, 1\right)\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right), x, -1\right), x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right) \cdot \mathsf{fma}\left(-1, x, 1\right)\\
\end{array}
\end{array}
if x < 0.0100000000000000002Initial program 8.1%
Taylor expanded in x around 0
Applied rewrites4.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f644.5
Applied rewrites4.5%
Taylor expanded in x around 0
lower-+.f647.1
Applied rewrites7.1%
Taylor expanded in x around 0
rec-expN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
fp-cancel-sign-subN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f647.1
Applied rewrites7.1%
if 0.0100000000000000002 < x Initial program 2.2%
Taylor expanded in x around 0
Applied rewrites97.7%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6497.7
Applied rewrites97.7%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
lower-fma.f642.5
Applied rewrites2.5%
Taylor expanded in x around 0
Applied rewrites97.3%
(FPCore (x) :precision binary64 (if (<= x 0.01) (* (fmod (+ 1.0 x) (fma (* x x) -0.25 1.0)) 1.0) (* (fmod 1.0 1.0) (fma -1.0 x 1.0))))
double code(double x) {
double tmp;
if (x <= 0.01) {
tmp = fmod((1.0 + x), fma((x * x), -0.25, 1.0)) * 1.0;
} else {
tmp = fmod(1.0, 1.0) * fma(-1.0, x, 1.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 0.01) tmp = Float64(rem(Float64(1.0 + x), fma(Float64(x * x), -0.25, 1.0)) * 1.0); else tmp = Float64(rem(1.0, 1.0) * fma(-1.0, x, 1.0)); end return tmp end
code[x_] := If[LessEqual[x, 0.01], N[(N[With[{TMP1 = N[(1.0 + x), $MachinePrecision], TMP2 = N[(N[(x * x), $MachinePrecision] * -0.25 + 1.0), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(-1.0 * x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.01:\\
\;\;\;\;\left(\left(1 + x\right) \bmod \left(\mathsf{fma}\left(x \cdot x, -0.25, 1\right)\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right) \cdot \mathsf{fma}\left(-1, x, 1\right)\\
\end{array}
\end{array}
if x < 0.0100000000000000002Initial program 8.1%
Taylor expanded in x around 0
Applied rewrites4.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f644.5
Applied rewrites4.5%
Taylor expanded in x around 0
lower-+.f647.1
Applied rewrites7.1%
Taylor expanded in x around 0
rec-exp6.6
Applied rewrites6.6%
if 0.0100000000000000002 < x Initial program 2.2%
Taylor expanded in x around 0
Applied rewrites97.7%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6497.7
Applied rewrites97.7%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
lower-fma.f642.5
Applied rewrites2.5%
Taylor expanded in x around 0
Applied rewrites97.3%
(FPCore (x) :precision binary64 (* (fmod 1.0 1.0) (fma -1.0 x 1.0)))
double code(double x) {
return fmod(1.0, 1.0) * fma(-1.0, x, 1.0);
}
function code(x) return Float64(rem(1.0, 1.0) * fma(-1.0, x, 1.0)) end
code[x_] := N[(N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(-1.0 * x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 \bmod 1\right) \cdot \mathsf{fma}\left(-1, x, 1\right)
\end{array}
Initial program 7.0%
Taylor expanded in x around 0
Applied rewrites23.0%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6423.0
Applied rewrites23.0%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
lower-fma.f644.1
Applied rewrites4.1%
Taylor expanded in x around 0
Applied rewrites22.7%
herbie shell --seed 2025089
(FPCore (x)
:name "expfmod (used to be hard to sample)"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))