
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
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, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
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, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t))
(t_2 (/ t_1 (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
(t_3 (fma (+ a y) y b))
(t_4 (fma (fma t_3 y c) y i)))
(if (<= t_2 2e+294)
(/ t_1 (+ (fma y c (* (* t_3 y) y)) i))
(if (<= t_2 INFINITY)
(*
(- x)
(+
(/ (- (* (* y y) (* y y))) t_4)
(-
(/
(/ (fma (fma (fma z y 27464.7644705) y 230661.510616) y t) t_4)
x))))
(+ (- (/ (- (- z) (* (- a) x)) y)) x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t;
double t_2 = t_1 / (((((((y + a) * y) + b) * y) + c) * y) + i);
double t_3 = fma((a + y), y, b);
double t_4 = fma(fma(t_3, y, c), y, i);
double tmp;
if (t_2 <= 2e+294) {
tmp = t_1 / (fma(y, c, ((t_3 * y) * y)) + i);
} else if (t_2 <= ((double) INFINITY)) {
tmp = -x * ((-((y * y) * (y * y)) / t_4) + -((fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / t_4) / x));
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) t_2 = Float64(t_1 / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) t_3 = fma(Float64(a + y), y, b) t_4 = fma(fma(t_3, y, c), y, i) tmp = 0.0 if (t_2 <= 2e+294) tmp = Float64(t_1 / Float64(fma(y, c, Float64(Float64(t_3 * y) * y)) + i)); elseif (t_2 <= Inf) tmp = Float64(Float64(-x) * Float64(Float64(Float64(-Float64(Float64(y * y) * Float64(y * y))) / t_4) + Float64(-Float64(Float64(fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / t_4) / x)))); else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 * y + c), $MachinePrecision] * y + i), $MachinePrecision]}, If[LessEqual[t$95$2, 2e+294], N[(t$95$1 / N[(N[(y * c + N[(N[(t$95$3 * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[((-x) * N[(N[((-N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]) / t$95$4), $MachinePrecision] + (-N[(N[(N[(N[(N[(z * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / t$95$4), $MachinePrecision] / x), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t\\
t_2 := \frac{t\_1}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
t_3 := \mathsf{fma}\left(a + y, y, b\right)\\
t_4 := \mathsf{fma}\left(\mathsf{fma}\left(t\_3, y, c\right), y, i\right)\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;\frac{t\_1}{\mathsf{fma}\left(y, c, \left(t\_3 \cdot y\right) \cdot y\right) + i}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\left(-x\right) \cdot \left(\frac{-\left(y \cdot y\right) \cdot \left(y \cdot y\right)}{t\_4} + \left(-\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{t\_4}}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < 2.00000000000000013e294Initial program 92.0%
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites92.0%
if 2.00000000000000013e294 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < +inf.0Initial program 55.6%
Taylor expanded in x around -inf
Applied rewrites79.5%
if +inf.0 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) Initial program 0.0%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.6
Applied rewrites69.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)))
(if (<= (/ t_1 (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)) INFINITY)
(/ t_1 (+ (fma y c (* (* (fma (+ a y) y b) y) y)) i))
(+ (- (/ (- (- z) (* (- a) x)) y)) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t;
double tmp;
if ((t_1 / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= ((double) INFINITY)) {
tmp = t_1 / (fma(y, c, ((fma((a + y), y, b) * y) * y)) + i);
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) tmp = 0.0 if (Float64(t_1 / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) <= Inf) tmp = Float64(t_1 / Float64(fma(y, c, Float64(Float64(fma(Float64(a + y), y, b) * y) * y)) + i)); else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[N[(t$95$1 / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 / N[(N[(y * c + N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t\\
\mathbf{if}\;\frac{t\_1}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \leq \infty:\\
\;\;\;\;\frac{t\_1}{\mathsf{fma}\left(y, c, \left(\mathsf{fma}\left(a + y, y, b\right) \cdot y\right) \cdot y\right) + i}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < +inf.0Initial program 90.2%
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites90.2%
if +inf.0 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) Initial program 0.0%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.6
Applied rewrites69.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))))
(if (<= t_1 INFINITY) t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = -((-z - (-a * x)) / y) + x return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = -((-z - (-a * x)) / y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < +inf.0Initial program 90.2%
if +inf.0 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) Initial program 0.0%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.6
Applied rewrites69.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -1.05e+56)
t_1
(if (<= y 1.9e+57)
(/
(fma (fma 27464.7644705 y 230661.510616) y t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -1.05e+56) {
tmp = t_1;
} else if (y <= 1.9e+57) {
tmp = fma(fma(27464.7644705, y, 230661.510616), y, t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -1.05e+56) tmp = t_1; elseif (y <= 1.9e+57) tmp = Float64(fma(fma(27464.7644705, y, 230661.510616), y, t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -1.05e+56], t$95$1, If[LessEqual[y, 1.9e+57], N[(N[(N[(27464.7644705 * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+57}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(27464.7644705, y, 230661.510616\right), y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.05000000000000009e56 or 1.8999999999999999e57 < y Initial program 1.9%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6468.4
Applied rewrites68.4%
if -1.05000000000000009e56 < y < 1.8999999999999999e57Initial program 92.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6479.4
Applied rewrites79.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -8.2e+55)
t_1
(if (<= y 3.3e+56)
(/ (fma 230661.510616 y t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -8.2e+55) {
tmp = t_1;
} else if (y <= 3.3e+56) {
tmp = fma(230661.510616, y, t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -8.2e+55) tmp = t_1; elseif (y <= 3.3e+56) tmp = Float64(fma(230661.510616, y, t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -8.2e+55], t$95$1, If[LessEqual[y, 3.3e+56], N[(N[(230661.510616 * y + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+56}:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.19999999999999962e55 or 3.30000000000000002e56 < y Initial program 2.0%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6468.2
Applied rewrites68.2%
if -8.19999999999999962e55 < y < 3.30000000000000002e56Initial program 93.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6478.3
Applied rewrites78.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -8.2e+55)
t_1
(if (<= y 3.3e+56) (/ t (fma (fma (fma (+ a y) y b) y c) y i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -8.2e+55) {
tmp = t_1;
} else if (y <= 3.3e+56) {
tmp = t / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -8.2e+55) tmp = t_1; elseif (y <= 3.3e+56) tmp = Float64(t / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -8.2e+55], t$95$1, If[LessEqual[y, 3.3e+56], N[(t / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+56}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.19999999999999962e55 or 3.30000000000000002e56 < y Initial program 2.0%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6468.2
Applied rewrites68.2%
if -8.19999999999999962e55 < y < 3.30000000000000002e56Initial program 93.1%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6466.4
Applied rewrites66.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -2.9e+50)
t_1
(if (<= y 0.0048) (fma y (/ 230661.510616 i) (/ t (fma c y i))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -2.9e+50) {
tmp = t_1;
} else if (y <= 0.0048) {
tmp = fma(y, (230661.510616 / i), (t / fma(c, y, i)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -2.9e+50) tmp = t_1; elseif (y <= 0.0048) tmp = fma(y, Float64(230661.510616 / i), Float64(t / fma(c, y, i))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -2.9e+50], t$95$1, If[LessEqual[y, 0.0048], N[(y * N[(230661.510616 / i), $MachinePrecision] + N[(t / N[(c * y + i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.0048:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{230661.510616}{i}, \frac{t}{\mathsf{fma}\left(c, y, i\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.9e50 or 0.00479999999999999958 < y Initial program 8.5%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6461.8
Applied rewrites61.8%
if -2.9e50 < y < 0.00479999999999999958Initial program 96.8%
Applied rewrites96.9%
Taylor expanded in y around 0
lower-/.f6470.2
Applied rewrites70.2%
Taylor expanded in y around 0
Applied rewrites66.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -1.4e+55)
t_1
(if (<= y 1.2e+49) (/ t (fma (* y y) (fma a y b) i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -1.4e+55) {
tmp = t_1;
} else if (y <= 1.2e+49) {
tmp = t / fma((y * y), fma(a, y, b), i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -1.4e+55) tmp = t_1; elseif (y <= 1.2e+49) tmp = Float64(t / fma(Float64(y * y), fma(a, y, b), i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -1.4e+55], t$95$1, If[LessEqual[y, 1.2e+49], N[(t / N[(N[(y * y), $MachinePrecision] * N[(a * y + b), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(a, y, b\right), i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.4e55 or 1.2e49 < y Initial program 2.5%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6467.5
Applied rewrites67.5%
if -1.4e55 < y < 1.2e49Initial program 93.8%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites72.9%
Taylor expanded in y around 0
Applied rewrites54.0%
Taylor expanded in y around 0
Applied rewrites53.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -2.9e+50)
t_1
(if (<= y 0.0048) (fma y (/ 230661.510616 i) (/ t i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -2.9e+50) {
tmp = t_1;
} else if (y <= 0.0048) {
tmp = fma(y, (230661.510616 / i), (t / i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -2.9e+50) tmp = t_1; elseif (y <= 0.0048) tmp = fma(y, Float64(230661.510616 / i), Float64(t / i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -2.9e+50], t$95$1, If[LessEqual[y, 0.0048], N[(y * N[(230661.510616 / i), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.0048:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{230661.510616}{i}, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.9e50 or 0.00479999999999999958 < y Initial program 8.5%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6461.8
Applied rewrites61.8%
if -2.9e50 < y < 0.00479999999999999958Initial program 96.8%
Applied rewrites96.9%
Taylor expanded in y around 0
lower-/.f6470.2
Applied rewrites70.2%
Taylor expanded in y around 0
Applied rewrites57.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -2650.0) x (if (<= y 0.0048) (fma y (/ 230661.510616 i) (/ t i)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -2650.0) {
tmp = x;
} else if (y <= 0.0048) {
tmp = fma(y, (230661.510616 / i), (t / i));
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -2650.0) tmp = x; elseif (y <= 0.0048) tmp = fma(y, Float64(230661.510616 / i), Float64(t / i)); else tmp = x; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -2650.0], x, If[LessEqual[y, 0.0048], N[(y * N[(230661.510616 / i), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2650:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.0048:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{230661.510616}{i}, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2650 or 0.00479999999999999958 < y Initial program 12.2%
Taylor expanded in y around inf
Applied rewrites47.8%
if -2650 < y < 0.00479999999999999958Initial program 99.7%
Applied rewrites99.5%
Taylor expanded in y around 0
lower-/.f6474.9
Applied rewrites74.9%
Taylor expanded in y around 0
Applied rewrites61.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -2650.0) x (if (<= y 0.0048) (fma 230661.510616 (/ y i) (/ t i)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -2650.0) {
tmp = x;
} else if (y <= 0.0048) {
tmp = fma(230661.510616, (y / i), (t / i));
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -2650.0) tmp = x; elseif (y <= 0.0048) tmp = fma(230661.510616, Float64(y / i), Float64(t / i)); else tmp = x; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -2650.0], x, If[LessEqual[y, 0.0048], N[(230661.510616 * N[(y / i), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2650:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.0048:\\
\;\;\;\;\mathsf{fma}\left(230661.510616, \frac{y}{i}, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2650 or 0.00479999999999999958 < y Initial program 12.2%
Taylor expanded in y around inf
Applied rewrites47.8%
if -2650 < y < 0.00479999999999999958Initial program 99.7%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -3.4e+56) x (if (<= y 6.5e+64) (/ t (fma (* y y) b i)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -3.4e+56) {
tmp = x;
} else if (y <= 6.5e+64) {
tmp = t / fma((y * y), b, i);
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -3.4e+56) tmp = x; elseif (y <= 6.5e+64) tmp = Float64(t / fma(Float64(y * y), b, i)); else tmp = x; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -3.4e+56], x, If[LessEqual[y, 6.5e+64], N[(t / N[(N[(y * y), $MachinePrecision] * b + i), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(y \cdot y, b, i\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.40000000000000001e56 or 6.50000000000000007e64 < y Initial program 1.6%
Taylor expanded in y around inf
Applied rewrites57.1%
if -3.40000000000000001e56 < y < 6.50000000000000007e64Initial program 92.1%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites71.7%
Taylor expanded in y around 0
Applied rewrites52.9%
Taylor expanded in y around 0
Applied rewrites50.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -2650.0) x (if (<= y 6.5e+64) (/ t i) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -2650.0) {
tmp = x;
} else if (y <= 6.5e+64) {
tmp = t / i;
} else {
tmp = x;
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= (-2650.0d0)) then
tmp = x
else if (y <= 6.5d+64) then
tmp = t / i
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -2650.0) {
tmp = x;
} else if (y <= 6.5e+64) {
tmp = t / i;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -2650.0: tmp = x elif y <= 6.5e+64: tmp = t / i else: tmp = x return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -2650.0) tmp = x; elseif (y <= 6.5e+64) tmp = Float64(t / i); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -2650.0) tmp = x; elseif (y <= 6.5e+64) tmp = t / i; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -2650.0], x, If[LessEqual[y, 6.5e+64], N[(t / i), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2650:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2650 or 6.50000000000000007e64 < y Initial program 6.8%
Taylor expanded in y around inf
Applied rewrites52.4%
if -2650 < y < 6.50000000000000007e64Initial program 95.0%
Taylor expanded in y around 0
lower-/.f6450.1
Applied rewrites50.1%
(FPCore (x y z t a b c i) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 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, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return x;
}
def code(x, y, z, t, a, b, c, i): return x
function code(x, y, z, t, a, b, c, i) return x end
function tmp = code(x, y, z, t, a, b, c, i) tmp = x; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 56.2%
Taylor expanded in y around inf
Applied rewrites25.6%
herbie shell --seed 2025115
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2"
:precision binary64
(/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))