
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * 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 = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * 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 = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((a * z) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((a * z) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((a * z) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((a * z) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 92.8%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 92.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (x y z t a b)
:precision binary64
(if (<=
z
-24000000000000000375037519247012851550741234072148780799542595377534166112665414846552412052370866763671531590001685424143056259581476864)
(* z (+ y (* a b)))
(+ (+ (* (+ (* b z) t) a) (* z y)) x)))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.4e+136) {
tmp = z * (y + (a * b));
} else {
tmp = ((((b * z) + t) * a) + (z * y)) + x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 (z <= (-2.4d+136)) then
tmp = z * (y + (a * b))
else
tmp = ((((b * z) + t) * a) + (z * y)) + x
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 (z <= -2.4e+136) {
tmp = z * (y + (a * b));
} else {
tmp = ((((b * z) + t) * a) + (z * y)) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.4e+136: tmp = z * (y + (a * b)) else: tmp = ((((b * z) + t) * a) + (z * y)) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.4e+136) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(z * y)) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.4e+136) tmp = z * (y + (a * b)); else tmp = ((((b * z) + t) * a) + (z * y)) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -24000000000000000375037519247012851550741234072148780799542595377534166112665414846552412052370866763671531590001685424143056259581476864], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -24000000000000000375037519247012851550741234072148780799542595377534166112665414846552412052370866763671531590001685424143056259581476864:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot z + t\right) \cdot a + z \cdot y\right) + x\\
\end{array}
if z < -2.4e136Initial program 92.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
if -2.4e136 < z Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ (* t a) (* z y)) x)))
(if (<=
t
-4942654315294039/13729595320261219429963801598162786434538870600286610818788926918371086366795312104245119281322909109954592622782961716074243975999433287625148056582230114304)
t_1
(if (<= t 204999999999999997902848)
(+ x (+ (* a (* b z)) (* y z)))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (z * y)) + x;
double tmp;
if (t <= -3.6e-142) {
tmp = t_1;
} else if (t <= 2.05e+23) {
tmp = x + ((a * (b * z)) + (y * z));
} 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 = ((t * a) + (z * y)) + x
if (t <= (-3.6d-142)) then
tmp = t_1
else if (t <= 2.05d+23) then
tmp = x + ((a * (b * z)) + (y * z))
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 = ((t * a) + (z * y)) + x;
double tmp;
if (t <= -3.6e-142) {
tmp = t_1;
} else if (t <= 2.05e+23) {
tmp = x + ((a * (b * z)) + (y * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (z * y)) + x tmp = 0 if t <= -3.6e-142: tmp = t_1 elif t <= 2.05e+23: tmp = x + ((a * (b * z)) + (y * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(z * y)) + x) tmp = 0.0 if (t <= -3.6e-142) tmp = t_1; elseif (t <= 2.05e+23) tmp = Float64(x + Float64(Float64(a * Float64(b * z)) + Float64(y * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (z * y)) + x; tmp = 0.0; if (t <= -3.6e-142) tmp = t_1; elseif (t <= 2.05e+23) tmp = x + ((a * (b * z)) + (y * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -4942654315294039/13729595320261219429963801598162786434538870600286610818788926918371086366795312104245119281322909109954592622782961716074243975999433287625148056582230114304], t$95$1, If[LessEqual[t, 204999999999999997902848], N[(x + N[(N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(t \cdot a + z \cdot y\right) + x\\
\mathbf{if}\;t \leq \frac{-4942654315294039}{13729595320261219429963801598162786434538870600286610818788926918371086366795312104245119281322909109954592622782961716074243975999433287625148056582230114304}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 204999999999999997902848:\\
\;\;\;\;x + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.6e-142 or 2.05e23 < t Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in z around 0
Applied rewrites76.3%
if -3.6e-142 < t < 2.05e23Initial program 92.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6470.9%
Applied rewrites70.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ (* t a) (* z y)) x)))
(if (<=
y
-8652089692998945/23384026197294446691258957323460528314494920687616)
t_1
(if (<=
y
13000000000000000250220688488498292662086011053465034426066648794239336448)
(+ (* a (+ t (* b z))) x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (z * y)) + x;
double tmp;
if (y <= -3.7e-34) {
tmp = t_1;
} else if (y <= 1.3e+73) {
tmp = (a * (t + (b * z))) + x;
} 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 = ((t * a) + (z * y)) + x
if (y <= (-3.7d-34)) then
tmp = t_1
else if (y <= 1.3d+73) then
tmp = (a * (t + (b * z))) + x
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 = ((t * a) + (z * y)) + x;
double tmp;
if (y <= -3.7e-34) {
tmp = t_1;
} else if (y <= 1.3e+73) {
tmp = (a * (t + (b * z))) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (z * y)) + x tmp = 0 if y <= -3.7e-34: tmp = t_1 elif y <= 1.3e+73: tmp = (a * (t + (b * z))) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(z * y)) + x) tmp = 0.0 if (y <= -3.7e-34) tmp = t_1; elseif (y <= 1.3e+73) tmp = Float64(Float64(a * Float64(t + Float64(b * z))) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (z * y)) + x; tmp = 0.0; if (y <= -3.7e-34) tmp = t_1; elseif (y <= 1.3e+73) tmp = (a * (t + (b * z))) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -8652089692998945/23384026197294446691258957323460528314494920687616], t$95$1, If[LessEqual[y, 13000000000000000250220688488498292662086011053465034426066648794239336448], N[(N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(t \cdot a + z \cdot y\right) + x\\
\mathbf{if}\;y \leq \frac{-8652089692998945}{23384026197294446691258957323460528314494920687616}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 13000000000000000250220688488498292662086011053465034426066648794239336448:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.6999999999999999e-34 or 1.3e73 < y Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in z around 0
Applied rewrites76.3%
if -3.6999999999999999e-34 < y < 1.3e73Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<=
z
-2199999999999999885260233413848058330640843229616793674173628649221800130588415029452562203177085987418885945263028424059069640212480)
t_1
(if (<=
z
35999999999999999245740906339966790167030859524511658159104163103288924474876839835625062400)
(+ (* a (+ t (* b z))) x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -2.2e+132) {
tmp = t_1;
} else if (z <= 3.6e+91) {
tmp = (a * (t + (b * z))) + x;
} 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 = z * (y + (a * b))
if (z <= (-2.2d+132)) then
tmp = t_1
else if (z <= 3.6d+91) then
tmp = (a * (t + (b * z))) + x
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 = z * (y + (a * b));
double tmp;
if (z <= -2.2e+132) {
tmp = t_1;
} else if (z <= 3.6e+91) {
tmp = (a * (t + (b * z))) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -2.2e+132: tmp = t_1 elif z <= 3.6e+91: tmp = (a * (t + (b * z))) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -2.2e+132) tmp = t_1; elseif (z <= 3.6e+91) tmp = Float64(Float64(a * Float64(t + Float64(b * z))) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -2.2e+132) tmp = t_1; elseif (z <= 3.6e+91) tmp = (a * (t + (b * z))) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2199999999999999885260233413848058330640843229616793674173628649221800130588415029452562203177085987418885945263028424059069640212480], t$95$1, If[LessEqual[z, 35999999999999999245740906339966790167030859524511658159104163103288924474876839835625062400], N[(N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -2199999999999999885260233413848058330640843229616793674173628649221800130588415029452562203177085987418885945263028424059069640212480:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 35999999999999999245740906339966790167030859524511658159104163103288924474876839835625062400:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.1999999999999999e132 or 3.5999999999999999e91 < z Initial program 92.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
if -2.1999999999999999e132 < z < 3.5999999999999999e91Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<=
z
-2374940160662717/91343852333181432387730302044767688728495783936)
t_1
(if (<=
z
3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072)
(+ (* a t) x)
(if (<=
z
299999999999999999088617516181804470671953197798974385752637440)
(+ x (* (* a z) b))
t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} else if (z <= 3e+62) {
tmp = x + ((a * 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 = z * (y + (a * b))
if (z <= (-2.6d-32)) then
tmp = t_1
else if (z <= 1.3d-80) then
tmp = (a * t) + x
else if (z <= 3d+62) then
tmp = x + ((a * 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 = z * (y + (a * b));
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} else if (z <= 3e+62) {
tmp = x + ((a * z) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -2.6e-32: tmp = t_1 elif z <= 1.3e-80: tmp = (a * t) + x elif z <= 3e+62: tmp = x + ((a * z) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -2.6e-32) tmp = t_1; elseif (z <= 1.3e-80) tmp = Float64(Float64(a * t) + x); elseif (z <= 3e+62) tmp = Float64(x + Float64(Float64(a * z) * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -2.6e-32) tmp = t_1; elseif (z <= 1.3e-80) tmp = (a * t) + x; elseif (z <= 3e+62) tmp = x + ((a * z) * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2374940160662717/91343852333181432387730302044767688728495783936], t$95$1, If[LessEqual[z, 3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072], N[(N[(a * t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 299999999999999999088617516181804470671953197798974385752637440], N[(x + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq \frac{-2374940160662717}{91343852333181432387730302044767688728495783936}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{3470978933371479}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\
\;\;\;\;a \cdot t + x\\
\mathbf{elif}\;z \leq 299999999999999999088617516181804470671953197798974385752637440:\\
\;\;\;\;x + \left(a \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.5999999999999997e-32 or 3e62 < z Initial program 92.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
if -2.5999999999999997e-32 < z < 1.3e-80Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
Taylor expanded in z around 0
Applied rewrites50.8%
if 1.3e-80 < z < 3e62Initial program 92.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6448.4%
Applied rewrites48.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6451.3%
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(if (<=
z
-2374940160662717/91343852333181432387730302044767688728495783936)
(* a (+ t (* b z)))
(if (<=
z
3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072)
(+ (* a t) x)
(+ x (* (* a z) b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.6e-32) {
tmp = a * (t + (b * z));
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} else {
tmp = x + ((a * 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 (z <= (-2.6d-32)) then
tmp = a * (t + (b * z))
else if (z <= 1.3d-80) then
tmp = (a * t) + x
else
tmp = x + ((a * 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 (z <= -2.6e-32) {
tmp = a * (t + (b * z));
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} else {
tmp = x + ((a * z) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.6e-32: tmp = a * (t + (b * z)) elif z <= 1.3e-80: tmp = (a * t) + x else: tmp = x + ((a * z) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.6e-32) tmp = Float64(a * Float64(t + Float64(b * z))); elseif (z <= 1.3e-80) tmp = Float64(Float64(a * t) + x); else tmp = Float64(x + Float64(Float64(a * z) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.6e-32) tmp = a * (t + (b * z)); elseif (z <= 1.3e-80) tmp = (a * t) + x; else tmp = x + ((a * z) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2374940160662717/91343852333181432387730302044767688728495783936], N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072], N[(N[(a * t), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-2374940160662717}{91343852333181432387730302044767688728495783936}:\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{elif}\;z \leq \frac{3470978933371479}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\
\;\;\;\;a \cdot t + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot z\right) \cdot b\\
\end{array}
if z < -2.5999999999999997e-32Initial program 92.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
if -2.5999999999999997e-32 < z < 1.3e-80Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
Taylor expanded in z around 0
Applied rewrites50.8%
if 1.3e-80 < z Initial program 92.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6448.4%
Applied rewrites48.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6451.3%
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* (* a z) b))))
(if (<=
z
-2374940160662717/91343852333181432387730302044767688728495783936)
t_1
(if (<=
z
3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072)
(+ (* a t) x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((a * z) * b);
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} 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 = x + ((a * z) * b)
if (z <= (-2.6d-32)) then
tmp = t_1
else if (z <= 1.3d-80) then
tmp = (a * t) + x
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 = x + ((a * z) * b);
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((a * z) * b) tmp = 0 if z <= -2.6e-32: tmp = t_1 elif z <= 1.3e-80: tmp = (a * t) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(a * z) * b)) tmp = 0.0 if (z <= -2.6e-32) tmp = t_1; elseif (z <= 1.3e-80) tmp = Float64(Float64(a * t) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((a * z) * b); tmp = 0.0; if (z <= -2.6e-32) tmp = t_1; elseif (z <= 1.3e-80) tmp = (a * t) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2374940160662717/91343852333181432387730302044767688728495783936], t$95$1, If[LessEqual[z, 3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072], N[(N[(a * t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \left(a \cdot z\right) \cdot b\\
\mathbf{if}\;z \leq \frac{-2374940160662717}{91343852333181432387730302044767688728495783936}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{3470978933371479}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\
\;\;\;\;a \cdot t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.5999999999999997e-32 or 1.3e-80 < z Initial program 92.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6448.4%
Applied rewrites48.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6451.3%
Applied rewrites51.3%
if -2.5999999999999997e-32 < z < 1.3e-80Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
Taylor expanded in z around 0
Applied rewrites50.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (* b z)))))
(if (<=
z
-2374940160662717/91343852333181432387730302044767688728495783936)
t_1
(if (<=
z
3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072)
(+ (* a t) x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (b * z));
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} 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 = x + (a * (b * z))
if (z <= (-2.6d-32)) then
tmp = t_1
else if (z <= 1.3d-80) then
tmp = (a * t) + x
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 = x + (a * (b * z));
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 1.3e-80) {
tmp = (a * t) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (b * z)) tmp = 0 if z <= -2.6e-32: tmp = t_1 elif z <= 1.3e-80: tmp = (a * t) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * Float64(b * z))) tmp = 0.0 if (z <= -2.6e-32) tmp = t_1; elseif (z <= 1.3e-80) tmp = Float64(Float64(a * t) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * (b * z)); tmp = 0.0; if (z <= -2.6e-32) tmp = t_1; elseif (z <= 1.3e-80) tmp = (a * t) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2374940160662717/91343852333181432387730302044767688728495783936], t$95$1, If[LessEqual[z, 3470978933371479/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072], N[(N[(a * t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + a \cdot \left(b \cdot z\right)\\
\mathbf{if}\;z \leq \frac{-2374940160662717}{91343852333181432387730302044767688728495783936}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{3470978933371479}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\
\;\;\;\;a \cdot t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.5999999999999997e-32 or 1.3e-80 < z Initial program 92.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6448.4%
Applied rewrites48.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
if -2.5999999999999997e-32 < z < 1.3e-80Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
Taylor expanded in z around 0
Applied rewrites50.8%
(FPCore (x y z t a b)
:precision binary64
(if (<=
z
-2374940160662717/91343852333181432387730302044767688728495783936)
(* a (* b z))
(if (<=
z
519999999999999967972319583654650286587951527928992692472643584)
(+ (* a t) x)
(* z (* a b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.6e-32) {
tmp = a * (b * z);
} else if (z <= 5.2e+62) {
tmp = (a * t) + x;
} else {
tmp = z * (a * 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 (z <= (-2.6d-32)) then
tmp = a * (b * z)
else if (z <= 5.2d+62) then
tmp = (a * t) + x
else
tmp = z * (a * 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 (z <= -2.6e-32) {
tmp = a * (b * z);
} else if (z <= 5.2e+62) {
tmp = (a * t) + x;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.6e-32: tmp = a * (b * z) elif z <= 5.2e+62: tmp = (a * t) + x else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.6e-32) tmp = Float64(a * Float64(b * z)); elseif (z <= 5.2e+62) tmp = Float64(Float64(a * t) + x); else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.6e-32) tmp = a * (b * z); elseif (z <= 5.2e+62) tmp = (a * t) + x; else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2374940160662717/91343852333181432387730302044767688728495783936], N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 519999999999999967972319583654650286587951527928992692472643584], N[(N[(a * t), $MachinePrecision] + x), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-2374940160662717}{91343852333181432387730302044767688728495783936}:\\
\;\;\;\;a \cdot \left(b \cdot z\right)\\
\mathbf{elif}\;z \leq 519999999999999967972319583654650286587951527928992692472643584:\\
\;\;\;\;a \cdot t + x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
if z < -2.5999999999999997e-32Initial program 92.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6448.4%
Applied rewrites48.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6427.4%
Applied rewrites27.4%
if -2.5999999999999997e-32 < z < 5.1999999999999997e62Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
Taylor expanded in z around 0
Applied rewrites50.8%
if 5.1999999999999997e62 < z Initial program 92.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
Taylor expanded in y around 0
lower-*.f6427.6%
Applied rewrites27.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* b z))))
(if (<=
z
-2374940160662717/91343852333181432387730302044767688728495783936)
t_1
(if (<=
z
6400000000000000093636449476319187398208275122333792379383109037886696731207348581826560)
(+ (* a t) x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (b * z);
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 6.4e+87) {
tmp = (a * t) + x;
} 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 = a * (b * z)
if (z <= (-2.6d-32)) then
tmp = t_1
else if (z <= 6.4d+87) then
tmp = (a * t) + x
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 = a * (b * z);
double tmp;
if (z <= -2.6e-32) {
tmp = t_1;
} else if (z <= 6.4e+87) {
tmp = (a * t) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (b * z) tmp = 0 if z <= -2.6e-32: tmp = t_1 elif z <= 6.4e+87: tmp = (a * t) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(b * z)) tmp = 0.0 if (z <= -2.6e-32) tmp = t_1; elseif (z <= 6.4e+87) tmp = Float64(Float64(a * t) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (b * z); tmp = 0.0; if (z <= -2.6e-32) tmp = t_1; elseif (z <= 6.4e+87) tmp = (a * t) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2374940160662717/91343852333181432387730302044767688728495783936], t$95$1, If[LessEqual[z, 6400000000000000093636449476319187398208275122333792379383109037886696731207348581826560], N[(N[(a * t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := a \cdot \left(b \cdot z\right)\\
\mathbf{if}\;z \leq \frac{-2374940160662717}{91343852333181432387730302044767688728495783936}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6400000000000000093636449476319187398208275122333792379383109037886696731207348581826560:\\
\;\;\;\;a \cdot t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.5999999999999997e-32 or 6.4000000000000001e87 < z Initial program 92.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6448.4%
Applied rewrites48.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6427.4%
Applied rewrites27.4%
if -2.5999999999999997e-32 < z < 6.4000000000000001e87Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
Taylor expanded in z around 0
Applied rewrites50.8%
(FPCore (x y z t a b) :precision binary64 (+ (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
return (a * t) + x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 = (a * t) + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (a * t) + x;
}
def code(x, y, z, t, a, b): return (a * t) + x
function code(x, y, z, t, a, b) return Float64(Float64(a * t) + x) end
function tmp = code(x, y, z, t, a, b) tmp = (a * t) + x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a * t), $MachinePrecision] + x), $MachinePrecision]
a \cdot t + x
Initial program 92.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites94.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6473.7%
Applied rewrites73.7%
Taylor expanded in z around 0
Applied rewrites50.8%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))