
(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 12 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)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(* z (/ y (* t (+ 1.0 (+ a (/ (* b y) t))))))
(if (<= t_1 -4e-303)
t_1
(if (<= t_1 0.0)
(/ (fma t (/ x y) z) b)
(if (<= t_1 INFINITY) t_1 (+ (/ z b) (* (/ t b) (/ x y)))))))))
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 <= -((double) INFINITY)) {
tmp = z * (y / (t * (1.0 + (a + ((b * y) / t)))));
} else if (t_1 <= -4e-303) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = fma(t, (x / y), z) / b;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (z / b) + ((t / b) * (x / y));
}
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 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(t * Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))))); elseif (t_1 <= -4e-303) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(z / b) + Float64(Float64(t / b) * Float64(x / y))); 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, (-Infinity)], N[(z * N[(y / N[(t * N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-303], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(z / b), $MachinePrecision] + N[(N[(t / b), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;z \cdot \frac{y}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{t}{b} \cdot \frac{x}{y}\\
\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))) < -inf.0Initial program 29.0%
Taylor expanded in y around inf
lower-/.f6455.4
Applied rewrites55.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites89.5%
Taylor expanded in x around 0
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-/.f6485.5
Applied rewrites85.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999999972e-303 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 94.1%
if -3.99999999999999972e-303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 55.8%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites63.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6468.0
Applied rewrites68.0%
+-commutative68.0
+-commutative68.0
*-commutative68.0
associate-*r/68.0
+-commutative68.0
associate-+l+68.0
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6470.8
Applied rewrites70.8%
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 0.0%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites62.5%
Taylor expanded in x around inf
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Final simplification90.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ 1.0 a)))
(t_3 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_3 (- INFINITY))
(* z (/ y (* t (+ 1.0 (+ a (/ (* b y) t))))))
(if (<= t_3 -4e-303)
t_2
(if (<= t_3 0.0)
(/ (fma t (/ x y) z) b)
(if (<= t_3 1e+38)
(/ x (fma b (/ y t) (+ 1.0 a)))
(if (<= t_3 2e+283)
t_2
(if (<= t_3 INFINITY)
(* (/ y a) (/ z t))
(+ (/ z b) (* (/ t b) (/ x y)))))))))))
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 / (1.0 + a);
double t_3 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = z * (y / (t * (1.0 + (a + ((b * y) / t)))));
} else if (t_3 <= -4e-303) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = fma(t, (x / y), z) / b;
} else if (t_3 <= 1e+38) {
tmp = x / fma(b, (y / t), (1.0 + a));
} else if (t_3 <= 2e+283) {
tmp = t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = (y / a) * (z / t);
} else {
tmp = (z / b) + ((t / b) * (x / y));
}
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(1.0 + a)) t_3 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(t * Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))))); elseif (t_3 <= -4e-303) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (t_3 <= 1e+38) tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + a))); elseif (t_3 <= 2e+283) tmp = t_2; elseif (t_3 <= Inf) tmp = Float64(Float64(y / a) * Float64(z / t)); else tmp = Float64(Float64(z / b) + Float64(Float64(t / b) * Float64(x / y))); 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[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(z * N[(y / N[(t * N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -4e-303], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$3, 1e+38], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+283], t$95$2, If[LessEqual[t$95$3, Infinity], N[(N[(y / a), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(t / b), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{1 + a}\\
t_3 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;z \cdot \frac{y}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}\\
\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_3 \leq 10^{+38}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{y}{a} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{t}{b} \cdot \frac{x}{y}\\
\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))) < -inf.0Initial program 29.0%
Taylor expanded in y around inf
lower-/.f6455.4
Applied rewrites55.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites89.5%
Taylor expanded in x around 0
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-/.f6485.5
Applied rewrites85.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999999972e-303 or 9.99999999999999977e37 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.99999999999999991e283Initial program 99.3%
Taylor expanded in y around 0
lower-+.f6476.6
Applied rewrites76.6%
if -3.99999999999999972e-303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 55.8%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites63.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6468.0
Applied rewrites68.0%
+-commutative68.0
+-commutative68.0
*-commutative68.0
associate-*r/68.0
+-commutative68.0
associate-+l+68.0
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6470.8
Applied rewrites70.8%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.99999999999999977e37Initial program 99.2%
Taylor expanded in x around inf
lower-/.f64N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6462.0
Applied rewrites62.0%
if 1.99999999999999991e283 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 38.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6426.8
Applied rewrites26.8%
Taylor expanded in a around inf
lower-/.f64N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6427.6
Applied rewrites27.6%
Taylor expanded in x around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-/.f6432.2
Applied rewrites32.2%
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 0.0%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites62.5%
Taylor expanded in x around inf
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Final simplification73.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ (fma b (/ y t) a) 1.0)))
(t_3 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_3 (- INFINITY))
(* z (/ y (* t (+ 1.0 (+ a (/ (* b y) t))))))
(if (<= t_3 -4e-303)
t_2
(if (<= t_3 0.0)
(/ (fma t (/ x y) z) b)
(if (<= t_3 2e+283)
t_2
(if (<= t_3 INFINITY)
(* (/ y a) (/ z t))
(+ (/ z b) (* (/ t b) (/ x y))))))))))
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 / (fma(b, (y / t), a) + 1.0);
double t_3 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = z * (y / (t * (1.0 + (a + ((b * y) / t)))));
} else if (t_3 <= -4e-303) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = fma(t, (x / y), z) / b;
} else if (t_3 <= 2e+283) {
tmp = t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = (y / a) * (z / t);
} else {
tmp = (z / b) + ((t / b) * (x / y));
}
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(fma(b, Float64(y / t), a) + 1.0)) t_3 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(t * Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))))); elseif (t_3 <= -4e-303) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (t_3 <= 2e+283) tmp = t_2; elseif (t_3 <= Inf) tmp = Float64(Float64(y / a) * Float64(z / t)); else tmp = Float64(Float64(z / b) + Float64(Float64(t / b) * Float64(x / y))); 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[(b * N[(y / t), $MachinePrecision] + a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(z * N[(y / N[(t * N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -4e-303], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$3, 2e+283], t$95$2, If[LessEqual[t$95$3, Infinity], N[(N[(y / a), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(t / b), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\mathsf{fma}\left(b, \frac{y}{t}, a\right) + 1}\\
t_3 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;z \cdot \frac{y}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}\\
\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{y}{a} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{t}{b} \cdot \frac{x}{y}\\
\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))) < -inf.0Initial program 29.0%
Taylor expanded in y around inf
lower-/.f6455.4
Applied rewrites55.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites89.5%
Taylor expanded in x around 0
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-/.f6485.5
Applied rewrites85.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -3.99999999999999972e-303 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.99999999999999991e283Initial program 99.3%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6496.6
Applied rewrites96.6%
if -3.99999999999999972e-303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 55.8%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites63.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6468.0
Applied rewrites68.0%
+-commutative68.0
+-commutative68.0
*-commutative68.0
associate-*r/68.0
+-commutative68.0
associate-+l+68.0
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6470.8
Applied rewrites70.8%
if 1.99999999999999991e283 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 38.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6426.8
Applied rewrites26.8%
Taylor expanded in a around inf
lower-/.f64N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6427.6
Applied rewrites27.6%
Taylor expanded in x around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-/.f6432.2
Applied rewrites32.2%
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 0.0%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites62.5%
Taylor expanded in x around inf
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -5e+111)
(/ (fma t (/ x y) z) b)
(if (<= b 8.6e+29)
(/ (+ x (/ (* y z) t)) (+ 1.0 a))
(+ (/ z b) (/ (/ (* t x) b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5e+111) {
tmp = fma(t, (x / y), z) / b;
} else if (b <= 8.6e+29) {
tmp = (x + ((y * z) / t)) / (1.0 + a);
} else {
tmp = (z / b) + (((t * x) / b) / y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5e+111) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (b <= 8.6e+29) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(1.0 + a)); else tmp = Float64(Float64(z / b) + Float64(Float64(Float64(t * x) / b) / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5e+111], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[b, 8.6e+29], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(t * x), $MachinePrecision] / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+29}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{t \cdot x}{b}}{y}\\
\end{array}
\end{array}
if b < -4.9999999999999997e111Initial program 63.9%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6462.0
Applied rewrites62.0%
+-commutative62.0
+-commutative62.0
*-commutative62.0
associate-*r/62.0
+-commutative62.0
associate-+l+62.0
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
if -4.9999999999999997e111 < b < 8.6000000000000006e29Initial program 81.6%
Taylor expanded in y around 0
lower-+.f6468.5
Applied rewrites68.5%
if 8.6000000000000006e29 < b Initial program 64.4%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites49.5%
Taylor expanded in x around inf
lift-/.f64N/A
lift-*.f6459.0
Applied rewrites59.0%
Final simplification65.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -5e+111)
(/ (fma t (/ x y) z) b)
(if (<= b 8.6e+29)
(/ (+ x (/ (* y z) t)) (+ 1.0 a))
(/ (+ z (/ (* t x) y)) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5e+111) {
tmp = fma(t, (x / y), z) / b;
} else if (b <= 8.6e+29) {
tmp = (x + ((y * z) / t)) / (1.0 + a);
} else {
tmp = (z + ((t * x) / y)) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5e+111) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (b <= 8.6e+29) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(1.0 + a)); else tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5e+111], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[b, 8.6e+29], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+29}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\end{array}
\end{array}
if b < -4.9999999999999997e111Initial program 63.9%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6462.0
Applied rewrites62.0%
+-commutative62.0
+-commutative62.0
*-commutative62.0
associate-*r/62.0
+-commutative62.0
associate-+l+62.0
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
if -4.9999999999999997e111 < b < 8.6000000000000006e29Initial program 81.6%
Taylor expanded in y around 0
lower-+.f6468.5
Applied rewrites68.5%
if 8.6000000000000006e29 < b Initial program 64.4%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites49.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6459.6
Applied rewrites59.6%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3e+21) (not (<= y 8.2e+27))) (/ (fma t (/ x y) z) b) (/ x (fma b (/ y t) (+ 1.0 a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3e+21) || !(y <= 8.2e+27)) {
tmp = fma(t, (x / y), z) / b;
} else {
tmp = x / fma(b, (y / t), (1.0 + a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3e+21) || !(y <= 8.2e+27)) tmp = Float64(fma(t, Float64(x / y), z) / b); else tmp = Float64(x / fma(b, Float64(y / t), Float64(1.0 + a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3e+21], N[Not[LessEqual[y, 8.2e+27]], $MachinePrecision]], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(b * N[(y / t), $MachinePrecision] + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+21} \lor \neg \left(y \leq 8.2 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(b, \frac{y}{t}, 1 + a\right)}\\
\end{array}
\end{array}
if y < -3e21 or 8.2000000000000005e27 < y Initial program 53.9%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6460.3
Applied rewrites60.3%
+-commutative60.3
+-commutative60.3
*-commutative60.3
associate-*r/60.3
+-commutative60.3
associate-+l+60.3
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6464.0
Applied rewrites64.0%
if -3e21 < y < 8.2000000000000005e27Initial program 92.8%
Taylor expanded in x around inf
lower-/.f64N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6468.7
Applied rewrites68.7%
Final simplification66.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -5e+111)
(/ (fma t (/ x y) z) b)
(if (<= b 8.6e+29)
(/ (fma y (/ z t) x) (+ 1.0 a))
(/ (+ z (/ (* t x) y)) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5e+111) {
tmp = fma(t, (x / y), z) / b;
} else if (b <= 8.6e+29) {
tmp = fma(y, (z / t), x) / (1.0 + a);
} else {
tmp = (z + ((t * x) / y)) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5e+111) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (b <= 8.6e+29) tmp = Float64(fma(y, Float64(z / t), x) / Float64(1.0 + a)); else tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5e+111], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[b, 8.6e+29], N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\end{array}
\end{array}
if b < -4.9999999999999997e111Initial program 63.9%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6462.0
Applied rewrites62.0%
+-commutative62.0
+-commutative62.0
*-commutative62.0
associate-*r/62.0
+-commutative62.0
associate-+l+62.0
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
if -4.9999999999999997e111 < b < 8.6000000000000006e29Initial program 81.6%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6468.7
Applied rewrites68.7%
if 8.6000000000000006e29 < b Initial program 64.4%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites49.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6459.6
Applied rewrites59.6%
Final simplification65.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.4e-66) (not (<= y 3.8e+27))) (/ (fma t (/ x y) z) b) (/ x (+ 1.0 a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.4e-66) || !(y <= 3.8e+27)) {
tmp = fma(t, (x / y), z) / b;
} else {
tmp = x / (1.0 + a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.4e-66) || !(y <= 3.8e+27)) tmp = Float64(fma(t, Float64(x / y), z) / b); else tmp = Float64(x / Float64(1.0 + a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.4e-66], N[Not[LessEqual[y, 3.8e+27]], $MachinePrecision]], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-66} \lor \neg \left(y \leq 3.8 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + a}\\
\end{array}
\end{array}
if y < -3.39999999999999997e-66 or 3.80000000000000022e27 < y Initial program 58.3%
Taylor expanded in y around inf
associate--l+N/A
lower-+.f64N/A
lower-/.f64N/A
associate-/r*N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
Applied rewrites42.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-*.f6457.3
Applied rewrites57.3%
+-commutative57.3
+-commutative57.3
*-commutative57.3
associate-*r/57.3
+-commutative57.3
associate-+l+57.3
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6460.4
Applied rewrites60.4%
if -3.39999999999999997e-66 < y < 3.80000000000000022e27Initial program 93.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6461.9
Applied rewrites61.9%
Final simplification61.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -9.2e-5)
(/ x a)
(if (<= a 2.45e-285)
(/ z b)
(if (<= a 6e-163) (/ x 1.0) (if (<= a 6e+36) (/ z b) (/ x a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.2e-5) {
tmp = x / a;
} else if (a <= 2.45e-285) {
tmp = z / b;
} else if (a <= 6e-163) {
tmp = x / 1.0;
} else if (a <= 6e+36) {
tmp = z / b;
} else {
tmp = x / a;
}
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 (a <= (-9.2d-5)) then
tmp = x / a
else if (a <= 2.45d-285) then
tmp = z / b
else if (a <= 6d-163) then
tmp = x / 1.0d0
else if (a <= 6d+36) then
tmp = z / b
else
tmp = x / a
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 (a <= -9.2e-5) {
tmp = x / a;
} else if (a <= 2.45e-285) {
tmp = z / b;
} else if (a <= 6e-163) {
tmp = x / 1.0;
} else if (a <= 6e+36) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9.2e-5: tmp = x / a elif a <= 2.45e-285: tmp = z / b elif a <= 6e-163: tmp = x / 1.0 elif a <= 6e+36: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9.2e-5) tmp = Float64(x / a); elseif (a <= 2.45e-285) tmp = Float64(z / b); elseif (a <= 6e-163) tmp = Float64(x / 1.0); elseif (a <= 6e+36) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9.2e-5) tmp = x / a; elseif (a <= 2.45e-285) tmp = z / b; elseif (a <= 6e-163) tmp = x / 1.0; elseif (a <= 6e+36) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9.2e-5], N[(x / a), $MachinePrecision], If[LessEqual[a, 2.45e-285], N[(z / b), $MachinePrecision], If[LessEqual[a, 6e-163], N[(x / 1.0), $MachinePrecision], If[LessEqual[a, 6e+36], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{-285}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-163}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{+36}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -9.20000000000000001e-5 or 6e36 < a Initial program 73.2%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6461.6
Applied rewrites61.6%
Taylor expanded in x around inf
Applied rewrites47.6%
Taylor expanded in a around inf
Applied rewrites46.8%
if -9.20000000000000001e-5 < a < 2.44999999999999987e-285 or 6.0000000000000005e-163 < a < 6e36Initial program 76.3%
Taylor expanded in y around inf
lower-/.f6437.7
Applied rewrites37.7%
if 2.44999999999999987e-285 < a < 6.0000000000000005e-163Initial program 76.3%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6449.9
Applied rewrites49.9%
Taylor expanded in x around inf
Applied rewrites35.8%
Taylor expanded in a around 0
Applied rewrites35.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3e+21) (not (<= y 8.2e+27))) (/ z b) (/ x (+ 1.0 a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3e+21) || !(y <= 8.2e+27)) {
tmp = z / b;
} else {
tmp = x / (1.0 + a);
}
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 <= (-3d+21)) .or. (.not. (y <= 8.2d+27))) then
tmp = z / b
else
tmp = x / (1.0d0 + a)
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 <= -3e+21) || !(y <= 8.2e+27)) {
tmp = z / b;
} else {
tmp = x / (1.0 + a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3e+21) or not (y <= 8.2e+27): tmp = z / b else: tmp = x / (1.0 + a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3e+21) || !(y <= 8.2e+27)) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3e+21) || ~((y <= 8.2e+27))) tmp = z / b; else tmp = x / (1.0 + a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3e+21], N[Not[LessEqual[y, 8.2e+27]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+21} \lor \neg \left(y \leq 8.2 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + a}\\
\end{array}
\end{array}
if y < -3e21 or 8.2000000000000005e27 < y Initial program 53.9%
Taylor expanded in y around inf
lower-/.f6453.6
Applied rewrites53.6%
if -3e21 < y < 8.2000000000000005e27Initial program 92.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6459.7
Applied rewrites59.7%
Final simplification56.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.95e-72) (not (<= y 2.4e+23))) (/ z b) (/ x 1.0)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.95e-72) || !(y <= 2.4e+23)) {
tmp = z / b;
} else {
tmp = x / 1.0;
}
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 <= (-2.95d-72)) .or. (.not. (y <= 2.4d+23))) then
tmp = z / b
else
tmp = x / 1.0d0
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 <= -2.95e-72) || !(y <= 2.4e+23)) {
tmp = z / b;
} else {
tmp = x / 1.0;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.95e-72) or not (y <= 2.4e+23): tmp = z / b else: tmp = x / 1.0 return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.95e-72) || !(y <= 2.4e+23)) tmp = Float64(z / b); else tmp = Float64(x / 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.95e-72) || ~((y <= 2.4e+23))) tmp = z / b; else tmp = x / 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.95e-72], N[Not[LessEqual[y, 2.4e+23]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.95 \cdot 10^{-72} \lor \neg \left(y \leq 2.4 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1}\\
\end{array}
\end{array}
if y < -2.9499999999999998e-72 or 2.4e23 < y Initial program 58.7%
Taylor expanded in y around inf
lower-/.f6449.7
Applied rewrites49.7%
if -2.9499999999999998e-72 < y < 2.4e23Initial program 93.8%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6474.0
Applied rewrites74.0%
Taylor expanded in x around inf
Applied rewrites62.2%
Taylor expanded in a around 0
Applied rewrites29.8%
Final simplification40.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 74.8%
Taylor expanded in y around inf
lower-/.f6434.4
Applied rewrites34.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2025086
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))