
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)
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
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)
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
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (* z (/ y (fma b y (fma a t t))))))
(if (<= t_2 -1e+297)
t_3
(if (<= t_2 1e+308)
(/ t_1 (fma b (/ y t) (- a -1.0)))
(if (<= t_2 INFINITY) t_3 (/ (fma t (/ x y) z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = z * (y / fma(b, y, fma(a, t, t)));
double tmp;
if (t_2 <= -1e+297) {
tmp = t_3;
} else if (t_2 <= 1e+308) {
tmp = t_1 / fma(b, (y / t), (a - -1.0));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = fma(t, (x / y), z) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(z * Float64(y / fma(b, y, fma(a, t, t)))) tmp = 0.0 if (t_2 <= -1e+297) tmp = t_3; elseif (t_2 <= 1e+308) tmp = Float64(t_1 / fma(b, Float64(y / t), Float64(a - -1.0))); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(fma(t, Float64(x / y), z) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(y / N[(b * y + N[(a * t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+297], t$95$3, If[LessEqual[t$95$2, 1e+308], N[(t$95$1 / N[(b * N[(y / t), $MachinePrecision] + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := z \cdot \frac{y}{\mathsf{fma}\left(b, y, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+297}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+308}:\\
\;\;\;\;\frac{t\_1}{\mathsf{fma}\left(b, \frac{y}{t}, a - -1\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1e297 or 1e308 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.0%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites62.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6441.8
Applied rewrites41.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6445.7
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f6445.7
Applied rewrites45.7%
if -1e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1e308Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.9
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval74.9
Applied rewrites74.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 1e+308)
t_1
(if (<= t_1 INFINITY)
(* z (/ y (fma b y (fma a t t))))
(/ (fma t (/ x y) z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= 1e+308) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = z * (y / fma(b, y, fma(a, t, t)));
} else {
tmp = fma(t, (x / y), z) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= 1e+308) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(z * Float64(y / fma(b, y, fma(a, t, t)))); else tmp = Float64(fma(t, Float64(x / y), z) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+308], t$95$1, If[LessEqual[t$95$1, Infinity], N[(z * N[(y / N[(b * y + N[(a * t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;z \cdot \frac{y}{\mathsf{fma}\left(b, y, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1e308Initial program 75.0%
if 1e308 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.0%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites62.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6441.8
Applied rewrites41.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6445.7
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f6445.7
Applied rewrites45.7%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 1e+308)
(/ (fma (/ z t) y x) (fma (/ b t) y (- a -1.0)))
(if (<= t_1 INFINITY)
(* z (/ y (fma b y (fma a t t))))
(/ (fma t (/ x y) z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= 1e+308) {
tmp = fma((z / t), y, x) / fma((b / t), y, (a - -1.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = z * (y / fma(b, y, fma(a, t, t)));
} else {
tmp = fma(t, (x / y), z) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= 1e+308) tmp = Float64(fma(Float64(z / t), y, x) / fma(Float64(b / t), y, Float64(a - -1.0))); elseif (t_1 <= Inf) tmp = Float64(z * Float64(y / fma(b, y, fma(a, t, t)))); else tmp = Float64(fma(t, Float64(x / y), z) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+308], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / N[(N[(b / t), $MachinePrecision] * y + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(z * N[(y / N[(b * y + N[(a * t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{\mathsf{fma}\left(\frac{b}{t}, y, a - -1\right)}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;z \cdot \frac{y}{\mathsf{fma}\left(b, y, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1e308Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.2
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.9
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval74.9
Applied rewrites74.9%
if 1e308 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.0%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites62.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6441.8
Applied rewrites41.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6445.7
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f6445.7
Applied rewrites45.7%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma z (/ y t) x) (+ 1.0 a))))
(if (<= t -7.8e+154)
t_1
(if (<= t 3.6e+55) (/ (fma x t (* y z)) (fma b y (fma a t t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (y / t), x) / (1.0 + a);
double tmp;
if (t <= -7.8e+154) {
tmp = t_1;
} else if (t <= 3.6e+55) {
tmp = fma(x, t, (y * z)) / fma(b, y, fma(a, t, t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(z, Float64(y / t), x) / Float64(1.0 + a)) tmp = 0.0 if (t <= -7.8e+154) tmp = t_1; elseif (t <= 3.6e+55) tmp = Float64(fma(x, t, Float64(y * z)) / fma(b, y, fma(a, t, t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.8e+154], t$95$1, If[LessEqual[t, 3.6e+55], N[(N[(x * t + N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(b * y + N[(a * t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{1 + a}\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{\mathsf{fma}\left(b, y, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.8000000000000006e154 or 3.59999999999999987e55 < t Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-+.f6458.4
Applied rewrites58.4%
if -7.8000000000000006e154 < t < 3.59999999999999987e55Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
lift-/.f64N/A
div-flipN/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Applied rewrites69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -1.45e+156)
t_1
(if (<= y -9.4e-101)
(* z (/ y (fma b y (fma a t t))))
(if (<= y 3e-222)
(/ x (+ 1.0 (+ a (/ (* b y) t))))
(if (<= y 2.2e+76) (/ (fma z (/ y t) x) (+ 1.0 a)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -1.45e+156) {
tmp = t_1;
} else if (y <= -9.4e-101) {
tmp = z * (y / fma(b, y, fma(a, t, t)));
} else if (y <= 3e-222) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (y <= 2.2e+76) {
tmp = fma(z, (y / t), x) / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -1.45e+156) tmp = t_1; elseif (y <= -9.4e-101) tmp = Float64(z * Float64(y / fma(b, y, fma(a, t, t)))); elseif (y <= 3e-222) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))); elseif (y <= 2.2e+76) tmp = Float64(fma(z, Float64(y / t), x) / Float64(1.0 + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -1.45e+156], t$95$1, If[LessEqual[y, -9.4e-101], N[(z * N[(y / N[(b * y + N[(a * t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-222], N[(x / N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+76], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.4 \cdot 10^{-101}:\\
\;\;\;\;z \cdot \frac{y}{\mathsf{fma}\left(b, y, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-222}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+76}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.45000000000000005e156 or 2.2e76 < y Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
if -1.45000000000000005e156 < y < -9.3999999999999999e-101Initial program 75.0%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites62.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6441.8
Applied rewrites41.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6445.7
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f6445.7
Applied rewrites45.7%
if -9.3999999999999999e-101 < y < 3.0000000000000003e-222Initial program 75.0%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.7
Applied rewrites52.7%
if 3.0000000000000003e-222 < y < 2.2e76Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-+.f6458.4
Applied rewrites58.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -8.7e+52)
t_1
(if (<= y 3e-222)
(/ x (+ 1.0 (+ a (/ (* b y) t))))
(if (<= y 2.2e+76) (/ (fma z (/ y t) x) (+ 1.0 a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -8.7e+52) {
tmp = t_1;
} else if (y <= 3e-222) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (y <= 2.2e+76) {
tmp = fma(z, (y / t), x) / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -8.7e+52) tmp = t_1; elseif (y <= 3e-222) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))); elseif (y <= 2.2e+76) tmp = Float64(fma(z, Float64(y / t), x) / Float64(1.0 + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -8.7e+52], t$95$1, If[LessEqual[y, 3e-222], N[(x / N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+76], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -8.7 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-222}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+76}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.69999999999999994e52 or 2.2e76 < y Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
if -8.69999999999999994e52 < y < 3.0000000000000003e-222Initial program 75.0%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.7
Applied rewrites52.7%
if 3.0000000000000003e-222 < y < 2.2e76Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-+.f6458.4
Applied rewrites58.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -3.1e+53)
t_1
(if (<= y 2.2e+76) (/ (fma z (/ y t) x) (+ 1.0 a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -3.1e+53) {
tmp = t_1;
} else if (y <= 2.2e+76) {
tmp = fma(z, (y / t), x) / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -3.1e+53) tmp = t_1; elseif (y <= 2.2e+76) tmp = Float64(fma(z, Float64(y / t), x) / Float64(1.0 + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -3.1e+53], t$95$1, If[LessEqual[y, 2.2e+76], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+76}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.10000000000000019e53 or 2.2e76 < y Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
if -3.10000000000000019e53 < y < 2.2e76Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-+.f6458.4
Applied rewrites58.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -1.8e-100)
t_1
(if (<= y 1.1e-75)
(/ x (- a -1.0))
(if (<= y 1.65e+59) (/ (fma (/ y t) z x) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -1.8e-100) {
tmp = t_1;
} else if (y <= 1.1e-75) {
tmp = x / (a - -1.0);
} else if (y <= 1.65e+59) {
tmp = fma((y / t), z, x) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -1.8e-100) tmp = t_1; elseif (y <= 1.1e-75) tmp = Float64(x / Float64(a - -1.0)); elseif (y <= 1.65e+59) tmp = Float64(fma(Float64(y / t), z, x) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -1.8e-100], t$95$1, If[LessEqual[y, 1.1e-75], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+59], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{-100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-75}:\\
\;\;\;\;\frac{x}{a - -1}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+59}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.7999999999999999e-100 or 1.65e59 < y Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
if -1.7999999999999999e-100 < y < 1.10000000000000003e-75Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.8
Applied rewrites42.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6442.8
Applied rewrites42.8%
if 1.10000000000000003e-75 < y < 1.65e59Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in a around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6434.2
Applied rewrites34.2%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f6435.3
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6435.3
Applied rewrites35.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -1.8e-100)
t_1
(if (<= y 1.85e+28)
(/ x (- a -1.0))
(if (<= y 2.15e+47) (* (/ z a) (/ y t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -1.8e-100) {
tmp = t_1;
} else if (y <= 1.85e+28) {
tmp = x / (a - -1.0);
} else if (y <= 2.15e+47) {
tmp = (z / a) * (y / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -1.8e-100) tmp = t_1; elseif (y <= 1.85e+28) tmp = Float64(x / Float64(a - -1.0)); elseif (y <= 2.15e+47) tmp = Float64(Float64(z / a) * Float64(y / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -1.8e-100], t$95$1, If[LessEqual[y, 1.85e+28], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+47], N[(N[(z / a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{-100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+28}:\\
\;\;\;\;\frac{x}{a - -1}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+47}:\\
\;\;\;\;\frac{z}{a} \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.7999999999999999e-100 or 2.14999999999999997e47 < y Initial program 75.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6425.7
Applied rewrites25.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
associate-*l/34.1
*-commutative34.1
+-commutative34.1
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6439.8
Applied rewrites39.8%
if -1.7999999999999999e-100 < y < 1.85e28Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.8
Applied rewrites42.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6442.8
Applied rewrites42.8%
if 1.85e28 < y < 2.14999999999999997e47Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in a around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6434.2
Applied rewrites34.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6416.6
Applied rewrites16.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6419.1
Applied rewrites19.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.05e-100)
(/ z b)
(if (<= y 1.85e+28)
(/ x (- a -1.0))
(if (<= y 2.6e+47) (* (/ z a) (/ y t)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-100) {
tmp = z / b;
} else if (y <= 1.85e+28) {
tmp = x / (a - -1.0);
} else if (y <= 2.6e+47) {
tmp = (z / a) * (y / t);
} else {
tmp = z / b;
}
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)
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) :: tmp
if (y <= (-1.05d-100)) then
tmp = z / b
else if (y <= 1.85d+28) then
tmp = x / (a - (-1.0d0))
else if (y <= 2.6d+47) then
tmp = (z / a) * (y / t)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-100) {
tmp = z / b;
} else if (y <= 1.85e+28) {
tmp = x / (a - -1.0);
} else if (y <= 2.6e+47) {
tmp = (z / a) * (y / t);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.05e-100: tmp = z / b elif y <= 1.85e+28: tmp = x / (a - -1.0) elif y <= 2.6e+47: tmp = (z / a) * (y / t) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.05e-100) tmp = Float64(z / b); elseif (y <= 1.85e+28) tmp = Float64(x / Float64(a - -1.0)); elseif (y <= 2.6e+47) tmp = Float64(Float64(z / a) * Float64(y / t)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.05e-100) tmp = z / b; elseif (y <= 1.85e+28) tmp = x / (a - -1.0); elseif (y <= 2.6e+47) tmp = (z / a) * (y / t); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.05e-100], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.85e+28], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+47], N[(N[(z / a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-100}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+28}:\\
\;\;\;\;\frac{x}{a - -1}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+47}:\\
\;\;\;\;\frac{z}{a} \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.05000000000000005e-100 or 2.60000000000000003e47 < y Initial program 75.0%
Taylor expanded in y around inf
lower-/.f6433.8
Applied rewrites33.8%
if -1.05000000000000005e-100 < y < 1.85e28Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.8
Applied rewrites42.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6442.8
Applied rewrites42.8%
if 1.85e28 < y < 2.60000000000000003e47Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in a around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6434.2
Applied rewrites34.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6416.6
Applied rewrites16.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6419.1
Applied rewrites19.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.05e-100) (/ z b) (if (<= y 4.4e+59) (/ x (- a -1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-100) {
tmp = z / b;
} else if (y <= 4.4e+59) {
tmp = x / (a - -1.0);
} else {
tmp = z / b;
}
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)
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) :: tmp
if (y <= (-1.05d-100)) then
tmp = z / b
else if (y <= 4.4d+59) then
tmp = x / (a - (-1.0d0))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-100) {
tmp = z / b;
} else if (y <= 4.4e+59) {
tmp = x / (a - -1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.05e-100: tmp = z / b elif y <= 4.4e+59: tmp = x / (a - -1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.05e-100) tmp = Float64(z / b); elseif (y <= 4.4e+59) tmp = Float64(x / Float64(a - -1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.05e-100) tmp = z / b; elseif (y <= 4.4e+59) tmp = x / (a - -1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.05e-100], N[(z / b), $MachinePrecision], If[LessEqual[y, 4.4e+59], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-100}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{a - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.05000000000000005e-100 or 4.3999999999999999e59 < y Initial program 75.0%
Taylor expanded in y around inf
lower-/.f6433.8
Applied rewrites33.8%
if -1.05000000000000005e-100 < y < 4.3999999999999999e59Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.8
Applied rewrites42.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6442.8
Applied rewrites42.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.05e-100) (/ z b) (if (<= y 4.4e+59) (/ x a) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-100) {
tmp = z / b;
} else if (y <= 4.4e+59) {
tmp = x / a;
} else {
tmp = z / b;
}
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)
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) :: tmp
if (y <= (-1.05d-100)) then
tmp = z / b
else if (y <= 4.4d+59) then
tmp = x / a
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-100) {
tmp = z / b;
} else if (y <= 4.4e+59) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.05e-100: tmp = z / b elif y <= 4.4e+59: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.05e-100) tmp = Float64(z / b); elseif (y <= 4.4e+59) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.05e-100) tmp = z / b; elseif (y <= 4.4e+59) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.05e-100], N[(z / b), $MachinePrecision], If[LessEqual[y, 4.4e+59], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-100}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.05000000000000005e-100 or 4.3999999999999999e59 < y Initial program 75.0%
Taylor expanded in y around inf
lower-/.f6433.8
Applied rewrites33.8%
if -1.05000000000000005e-100 < y < 4.3999999999999999e59Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
Taylor expanded in a around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6434.2
Applied rewrites34.2%
Taylor expanded in x around inf
lower-/.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a b) :precision binary64 (/ z b))
double code(double x, double y, double z, double t, double a, double b) {
return z / b;
}
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)
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
code = z / b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z / b;
}
def code(x, y, z, t, a, b): return z / b
function code(x, y, z, t, a, b) return Float64(z / b) end
function tmp = code(x, y, z, t, a, b) tmp = z / b; end
code[x_, y_, z_, t_, a_, b_] := N[(z / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{b}
\end{array}
Initial program 75.0%
Taylor expanded in y around inf
lower-/.f6433.8
Applied rewrites33.8%
herbie shell --seed 2025156
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))