
(FPCore (x y z)
:precision binary64
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+ (* x 104109730557/25000000000) 393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+ (* (+ x 216700011257/5000000000) x) 263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000)))double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z): return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z) return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) end
function tmp = code(x, y, z) tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); end
code[x_, y_, z_] := N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision]
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+ (* x 104109730557/25000000000) 393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+ (* (+ x 216700011257/5000000000) x) 263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000)))double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z): return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z) return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) end
function tmp = code(x, y, z) tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); end
code[x_, y_, z_] := N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision]
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}}
(FPCore (x y z)
:precision binary64
(let* ((t_0
(-
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)
-23533438303/500000000)))
(if (<=
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))
INFINITY)
(+
(* (/ z t_0) (- x 2))
(*
(*
(-
y
(*
(* -4297481763/31250000 x)
(-
(*
(- (* 104109730557/25000000000 x) -393497462077/5000000000)
(* x 31250000/4297481763))
-1)))
(/ x t_0))
(- x 2)))
(*
-1
(*
x
(-
(*
-1
(/
(-
(*
-1
(/
(-
(+
(* -1 (/ y x))
(*
409304707811198655637810418659684985388407301/3125000000000000000000000000000000000000
(/ 1 x)))
2284450290879775841688574159837293/625000000000000000000000000000)
x))
13764240537310136880149/125000000000000000000)
x))
104109730557/25000000000))))))double code(double x, double y, double z) {
double t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606;
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= ((double) INFINITY)) {
tmp = ((z / t_0) * (x - 2.0)) + (((y - ((-137.519416416 * x) * ((((4.16438922228 * x) - -78.6994924154) * (x * 0.007271700433740735)) - -1.0))) * (x / t_0)) * (x - 2.0));
} else {
tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606;
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Double.POSITIVE_INFINITY) {
tmp = ((z / t_0) * (x - 2.0)) + (((y - ((-137.519416416 * x) * ((((4.16438922228 * x) - -78.6994924154) * (x * 0.007271700433740735)) - -1.0))) * (x / t_0)) * (x - 2.0));
} else {
tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228));
}
return tmp;
}
def code(x, y, z): t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606 tmp = 0 if (((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= math.inf: tmp = ((z / t_0) * (x - 2.0)) + (((y - ((-137.519416416 * x) * ((((4.16438922228 * x) - -78.6994924154) * (x * 0.007271700433740735)) - -1.0))) * (x / t_0)) * (x - 2.0)) else: tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = Float64(Float64(Float64(z / t_0) * Float64(x - 2.0)) + Float64(Float64(Float64(y - Float64(Float64(-137.519416416 * x) * Float64(Float64(Float64(Float64(4.16438922228 * x) - -78.6994924154) * Float64(x * 0.007271700433740735)) - -1.0))) * Float64(x / t_0)) * Float64(x - 2.0))); else tmp = Float64(-1.0 * Float64(x * Float64(Float64(-1.0 * Float64(Float64(Float64(-1.0 * Float64(Float64(Float64(Float64(-1.0 * Float64(y / x)) + Float64(130977.50649958357 * Float64(1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606; tmp = 0.0; if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = ((z / t_0) * (x - 2.0)) + (((y - ((-137.519416416 * x) * ((((4.16438922228 * x) - -78.6994924154) * (x * 0.007271700433740735)) - -1.0))) * (x / t_0)) * (x - 2.0)); else tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(N[(N[(x - -216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] - -263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] - -156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] - -23533438303/500000000), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(z / t$95$0), $MachinePrecision] * N[(x - 2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y - N[(N[(-4297481763/31250000 * x), $MachinePrecision] * N[(N[(N[(N[(104109730557/25000000000 * x), $MachinePrecision] - -393497462077/5000000000), $MachinePrecision] * N[(x * 31250000/4297481763), $MachinePrecision]), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(x - 2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1 * N[(x * N[(N[(-1 * N[(N[(N[(-1 * N[(N[(N[(N[(-1 * N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(409304707811198655637810418659684985388407301/3125000000000000000000000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2284450290879775841688574159837293/625000000000000000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - 13764240537310136880149/125000000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - 104109730557/25000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x - \frac{-23533438303}{500000000}\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}} \leq \infty:\\
\;\;\;\;\frac{z}{t\_0} \cdot \left(x - 2\right) + \left(\left(y - \left(\frac{-4297481763}{31250000} \cdot x\right) \cdot \left(\left(\frac{104109730557}{25000000000} \cdot x - \frac{-393497462077}{5000000000}\right) \cdot \left(x \cdot \frac{31250000}{4297481763}\right) - -1\right)\right) \cdot \frac{x}{t\_0}\right) \cdot \left(x - 2\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(-1 \cdot \frac{-1 \cdot \frac{\left(-1 \cdot \frac{y}{x} + \frac{409304707811198655637810418659684985388407301}{3125000000000000000000000000000000000000} \cdot \frac{1}{x}\right) - \frac{2284450290879775841688574159837293}{625000000000000000000000000000}}{x} - \frac{13764240537310136880149}{125000000000000000000}}{x} - \frac{104109730557}{25000000000}\right)\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < +inf.0Initial program 58.7%
Applied rewrites62.6%
Applied rewrites62.6%
if +inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
Taylor expanded in x around -inf
Applied rewrites47.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(-
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)
-23533438303/500000000)))
(if (<=
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))
INFINITY)
(+
(* (/ z t_0) (- x 2))
(*
(*
(+
y
(*
(-
(*
(- (* 104109730557/25000000000 x) -393497462077/5000000000)
x)
-4297481763/31250000)
x))
(/ x t_0))
(- x 2)))
(*
-1
(*
x
(-
(*
-1
(/
(-
(*
-1
(/
(-
(+
(* -1 (/ y x))
(*
409304707811198655637810418659684985388407301/3125000000000000000000000000000000000000
(/ 1 x)))
2284450290879775841688574159837293/625000000000000000000000000000)
x))
13764240537310136880149/125000000000000000000)
x))
104109730557/25000000000))))))double code(double x, double y, double z) {
double t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606;
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= ((double) INFINITY)) {
tmp = ((z / t_0) * (x - 2.0)) + (((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * (x / t_0)) * (x - 2.0));
} else {
tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606;
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Double.POSITIVE_INFINITY) {
tmp = ((z / t_0) * (x - 2.0)) + (((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * (x / t_0)) * (x - 2.0));
} else {
tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228));
}
return tmp;
}
def code(x, y, z): t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606 tmp = 0 if (((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= math.inf: tmp = ((z / t_0) * (x - 2.0)) + (((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * (x / t_0)) * (x - 2.0)) else: tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = Float64(Float64(Float64(z / t_0) * Float64(x - 2.0)) + Float64(Float64(Float64(y + Float64(Float64(Float64(Float64(Float64(4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * Float64(x / t_0)) * Float64(x - 2.0))); else tmp = Float64(-1.0 * Float64(x * Float64(Float64(-1.0 * Float64(Float64(Float64(-1.0 * Float64(Float64(Float64(Float64(-1.0 * Float64(y / x)) + Float64(130977.50649958357 * Float64(1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606; tmp = 0.0; if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = ((z / t_0) * (x - 2.0)) + (((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * (x / t_0)) * (x - 2.0)); else tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(N[(N[(x - -216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] - -263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] - -156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] - -23533438303/500000000), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(z / t$95$0), $MachinePrecision] * N[(x - 2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + N[(N[(N[(N[(N[(104109730557/25000000000 * x), $MachinePrecision] - -393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] - -4297481763/31250000), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(x / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(x - 2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1 * N[(x * N[(N[(-1 * N[(N[(N[(-1 * N[(N[(N[(N[(-1 * N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(409304707811198655637810418659684985388407301/3125000000000000000000000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2284450290879775841688574159837293/625000000000000000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - 13764240537310136880149/125000000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - 104109730557/25000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x - \frac{-23533438303}{500000000}\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}} \leq \infty:\\
\;\;\;\;\frac{z}{t\_0} \cdot \left(x - 2\right) + \left(\left(y + \left(\left(\frac{104109730557}{25000000000} \cdot x - \frac{-393497462077}{5000000000}\right) \cdot x - \frac{-4297481763}{31250000}\right) \cdot x\right) \cdot \frac{x}{t\_0}\right) \cdot \left(x - 2\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(-1 \cdot \frac{-1 \cdot \frac{\left(-1 \cdot \frac{y}{x} + \frac{409304707811198655637810418659684985388407301}{3125000000000000000000000000000000000000} \cdot \frac{1}{x}\right) - \frac{2284450290879775841688574159837293}{625000000000000000000000000000}}{x} - \frac{13764240537310136880149}{125000000000000000000}}{x} - \frac{104109730557}{25000000000}\right)\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < +inf.0Initial program 58.7%
Applied rewrites62.6%
if +inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
Taylor expanded in x around -inf
Applied rewrites47.4%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))
INFINITY)
(134-z0z1z2z3z4
(/
-1
(-
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)
-23533438303/500000000))
(-
(*
(-
-4297481763/31250000
(*
(- (* 104109730557/25000000000 x) -393497462077/5000000000)
x))
x)
y)
(* (- x 2) x)
(- x 2)
z)
(*
-1
(*
x
(-
(*
-1
(/
(-
(*
-1
(/
(-
(+
(* -1 (/ y x))
(*
409304707811198655637810418659684985388407301/3125000000000000000000000000000000000000
(/ 1 x)))
2284450290879775841688574159837293/625000000000000000000000000000)
x))
13764240537310136880149/125000000000000000000)
x))
104109730557/25000000000)))))\begin{array}{l}
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}} \leq \infty:\\
\;\;\;\;\mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{\left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x - \frac{-23533438303}{500000000}}\right), \left(\left(\frac{-4297481763}{31250000} - \left(\frac{104109730557}{25000000000} \cdot x - \frac{-393497462077}{5000000000}\right) \cdot x\right) \cdot x - y\right), \left(\left(x - 2\right) \cdot x\right), \left(x - 2\right), z\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(-1 \cdot \frac{-1 \cdot \frac{\left(-1 \cdot \frac{y}{x} + \frac{409304707811198655637810418659684985388407301}{3125000000000000000000000000000000000000} \cdot \frac{1}{x}\right) - \frac{2284450290879775841688574159837293}{625000000000000000000000000000}}{x} - \frac{13764240537310136880149}{125000000000000000000}}{x} - \frac{104109730557}{25000000000}\right)\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < +inf.0Initial program 58.7%
Applied rewrites62.5%
if +inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
Taylor expanded in x around -inf
Applied rewrites47.4%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))
INFINITY)
(*
(/
(- 2 x)
(-
-23533438303/500000000
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)))
(+
z
(*
(+
y
(*
(-
(*
(- (* 104109730557/25000000000 x) -393497462077/5000000000)
x)
-4297481763/31250000)
x))
x)))
(*
-1
(*
x
(-
(*
-1
(/
(-
(*
-1
(/
(-
(+
(* -1 (/ y x))
(*
409304707811198655637810418659684985388407301/3125000000000000000000000000000000000000
(/ 1 x)))
2284450290879775841688574159837293/625000000000000000000000000000)
x))
13764240537310136880149/125000000000000000000)
x))
104109730557/25000000000)))))double code(double x, double y, double z) {
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= ((double) INFINITY)) {
tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x));
} else {
tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228));
}
return tmp;
}
public static double code(double x, double y, double z) {
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Double.POSITIVE_INFINITY) {
tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x));
} else {
tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= math.inf: tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x)) else: tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228)) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = Float64(Float64(Float64(2.0 - x) / Float64(-47.066876606 - Float64(Float64(Float64(Float64(Float64(Float64(x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * Float64(z + Float64(Float64(y + Float64(Float64(Float64(Float64(Float64(4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x))); else tmp = Float64(-1.0 * Float64(x * Float64(Float64(-1.0 * Float64(Float64(Float64(-1.0 * Float64(Float64(Float64(Float64(-1.0 * Float64(y / x)) + Float64(130977.50649958357 * Float64(1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x)); else tmp = -1.0 * (x * ((-1.0 * (((-1.0 * ((((-1.0 * (y / x)) + (130977.50649958357 * (1.0 / x))) - 3655.1204654076414) / x)) - 110.1139242984811) / x)) - 4.16438922228)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(2 - x), $MachinePrecision] / N[(-23533438303/500000000 - N[(N[(N[(N[(N[(N[(x - -216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] - -263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] - -156699607947/500000000), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + N[(N[(y + N[(N[(N[(N[(N[(104109730557/25000000000 * x), $MachinePrecision] - -393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] - -4297481763/31250000), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1 * N[(x * N[(N[(-1 * N[(N[(N[(-1 * N[(N[(N[(N[(-1 * N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(409304707811198655637810418659684985388407301/3125000000000000000000000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2284450290879775841688574159837293/625000000000000000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - 13764240537310136880149/125000000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - 104109730557/25000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}} \leq \infty:\\
\;\;\;\;\frac{2 - x}{\frac{-23533438303}{500000000} - \left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x} \cdot \left(z + \left(y + \left(\left(\frac{104109730557}{25000000000} \cdot x - \frac{-393497462077}{5000000000}\right) \cdot x - \frac{-4297481763}{31250000}\right) \cdot x\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(-1 \cdot \frac{-1 \cdot \frac{\left(-1 \cdot \frac{y}{x} + \frac{409304707811198655637810418659684985388407301}{3125000000000000000000000000000000000000} \cdot \frac{1}{x}\right) - \frac{2284450290879775841688574159837293}{625000000000000000000000000000}}{x} - \frac{13764240537310136880149}{125000000000000000000}}{x} - \frac{104109730557}{25000000000}\right)\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < +inf.0Initial program 58.7%
Applied rewrites61.6%
if +inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
Taylor expanded in x around -inf
Applied rewrites47.4%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))
INFINITY)
(*
(/
(- 2 x)
(-
-23533438303/500000000
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)))
(+
z
(*
(+
y
(*
(-
(*
(- (* 104109730557/25000000000 x) -393497462077/5000000000)
x)
-4297481763/31250000)
x))
x)))
(*
x
(-
104109730557/25000000000
(* 13764240537310136880149/125000000000000000000 (/ 1 x))))))double code(double x, double y, double z) {
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= ((double) INFINITY)) {
tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x));
} else {
tmp = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
}
return tmp;
}
public static double code(double x, double y, double z) {
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Double.POSITIVE_INFINITY) {
tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x));
} else {
tmp = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= math.inf: tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x)) else: tmp = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = Float64(Float64(Float64(2.0 - x) / Float64(-47.066876606 - Float64(Float64(Float64(Float64(Float64(Float64(x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * Float64(z + Float64(Float64(y + Float64(Float64(Float64(Float64(Float64(4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x))); else tmp = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= Inf) tmp = ((2.0 - x) / (-47.066876606 - ((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x))) * (z + ((y + (((((4.16438922228 * x) - -78.6994924154) * x) - -137.519416416) * x)) * x)); else tmp = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(2 - x), $MachinePrecision] / N[(-23533438303/500000000 - N[(N[(N[(N[(N[(N[(x - -216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] - -263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] - -156699607947/500000000), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + N[(N[(y + N[(N[(N[(N[(N[(104109730557/25000000000 * x), $MachinePrecision] - -393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] - -4297481763/31250000), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(104109730557/25000000000 - N[(13764240537310136880149/125000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}} \leq \infty:\\
\;\;\;\;\frac{2 - x}{\frac{-23533438303}{500000000} - \left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x} \cdot \left(z + \left(y + \left(\left(\frac{104109730557}{25000000000} \cdot x - \frac{-393497462077}{5000000000}\right) \cdot x - \frac{-4297481763}{31250000}\right) \cdot x\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{104109730557}{25000000000} - \frac{13764240537310136880149}{125000000000000000000} \cdot \frac{1}{x}\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < +inf.0Initial program 58.7%
Applied rewrites61.6%
if +inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6444.8%
Applied rewrites44.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
(- x 2)
(+
104109730557/25000000000
(/
z
(-
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)
-23533438303/500000000))))))
(if (<= x -2250000000000000000)
t_0
(if (<= x 37999999999999998955653073598507122688)
(/
(* (- x 2) (+ (* (+ (* 4297481763/31250000 x) y) x) z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))
t_0))))double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)));
double tmp;
if (x <= -2.25e+18) {
tmp = t_0;
} else if (x <= 3.8e+37) {
tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x - 2.0d0) * (4.16438922228d0 + (z / (((((((x - (-43.3400022514d0)) * x) - (-263.505074721d0)) * x) - (-313.399215894d0)) * x) - (-47.066876606d0))))
if (x <= (-2.25d+18)) then
tmp = t_0
else if (x <= 3.8d+37) then
tmp = ((x - 2.0d0) * ((((137.519416416d0 * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)));
double tmp;
if (x <= -2.25e+18) {
tmp = t_0;
} else if (x <= 3.8e+37) {
tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606))) tmp = 0 if x <= -2.25e+18: tmp = t_0 elif x <= 3.8e+37: tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x - 2.0) * Float64(4.16438922228 + Float64(z / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)))) tmp = 0.0 if (x <= -2.25e+18) tmp = t_0; elseif (x <= 3.8e+37) tmp = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(137.519416416 * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606))); tmp = 0.0; if (x <= -2.25e+18) tmp = t_0; elseif (x <= 3.8e+37) tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - 2), $MachinePrecision] * N[(104109730557/25000000000 + N[(z / N[(N[(N[(N[(N[(N[(N[(x - -216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] - -263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] - -156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] - -23533438303/500000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2250000000000000000], t$95$0, If[LessEqual[x, 37999999999999998955653073598507122688], N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(4297481763/31250000 * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left(x - 2\right) \cdot \left(\frac{104109730557}{25000000000} + \frac{z}{\left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x - \frac{-23533438303}{500000000}}\right)\\
\mathbf{if}\;x \leq -2250000000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 37999999999999998955653073598507122688:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(\frac{4297481763}{31250000} \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -2.25e18 or 3.7999999999999999e37 < x Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.0%
if -2.25e18 < x < 3.7999999999999999e37Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites54.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
(- x 2)
(+
104109730557/25000000000
(/
z
(-
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)
-23533438303/500000000))))))
(if (<= x -4835703278458517/302231454903657293676544)
t_0
(if (<=
x
7849862309882779/44601490397061246283071436545296723011960832)
(/
(* (- x 2) (+ (* (+ (* 4297481763/31250000 x) y) x) z))
(+ (* 156699607947/500000000 x) 23533438303/500000000))
t_0))))double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)));
double tmp;
if (x <= -1.6e-8) {
tmp = t_0;
} else if (x <= 1.76e-28) {
tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606);
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x - 2.0d0) * (4.16438922228d0 + (z / (((((((x - (-43.3400022514d0)) * x) - (-263.505074721d0)) * x) - (-313.399215894d0)) * x) - (-47.066876606d0))))
if (x <= (-1.6d-8)) then
tmp = t_0
else if (x <= 1.76d-28) then
tmp = ((x - 2.0d0) * ((((137.519416416d0 * x) + y) * x) + z)) / ((313.399215894d0 * x) + 47.066876606d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)));
double tmp;
if (x <= -1.6e-8) {
tmp = t_0;
} else if (x <= 1.76e-28) {
tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606))) tmp = 0 if x <= -1.6e-8: tmp = t_0 elif x <= 1.76e-28: tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x - 2.0) * Float64(4.16438922228 + Float64(z / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)))) tmp = 0.0 if (x <= -1.6e-8) tmp = t_0; elseif (x <= 1.76e-28) tmp = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(137.519416416 * x) + y) * x) + z)) / Float64(Float64(313.399215894 * x) + 47.066876606)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606))); tmp = 0.0; if (x <= -1.6e-8) tmp = t_0; elseif (x <= 1.76e-28) tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - 2), $MachinePrecision] * N[(104109730557/25000000000 + N[(z / N[(N[(N[(N[(N[(N[(N[(x - -216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] - -263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] - -156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] - -23533438303/500000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4835703278458517/302231454903657293676544], t$95$0, If[LessEqual[x, 7849862309882779/44601490397061246283071436545296723011960832], N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(4297481763/31250000 * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(156699607947/500000000 * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left(x - 2\right) \cdot \left(\frac{104109730557}{25000000000} + \frac{z}{\left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x - \frac{-23533438303}{500000000}}\right)\\
\mathbf{if}\;x \leq \frac{-4835703278458517}{302231454903657293676544}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq \frac{7849862309882779}{44601490397061246283071436545296723011960832}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(\frac{4297481763}{31250000} \cdot x + y\right) \cdot x + z\right)}{\frac{156699607947}{500000000} \cdot x + \frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1.6000000000000001e-8 or 1.7599999999999999e-28 < x Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.0%
if -1.6000000000000001e-8 < x < 1.7599999999999999e-28Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites51.5%
Taylor expanded in x around 0
Applied rewrites51.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
(- x 2)
(+
104109730557/25000000000
(/
z
(-
(*
(-
(*
(-
(* (- x -216700011257/5000000000) x)
-263505074721/1000000000)
x)
-156699607947/500000000)
x)
-23533438303/500000000))))))
(if (<= x -4835703278458517/302231454903657293676544)
t_0
(if (<=
x
7849862309882779/44601490397061246283071436545296723011960832)
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+ (* 156699607947/500000000 x) 23533438303/500000000))
t_0))))double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)));
double tmp;
if (x <= -1.6e-8) {
tmp = t_0;
} else if (x <= 1.76e-28) {
tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606);
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x - 2.0d0) * (4.16438922228d0 + (z / (((((((x - (-43.3400022514d0)) * x) - (-263.505074721d0)) * x) - (-313.399215894d0)) * x) - (-47.066876606d0))))
if (x <= (-1.6d-8)) then
tmp = t_0
else if (x <= 1.76d-28) then
tmp = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / ((313.399215894d0 * x) + 47.066876606d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)));
double tmp;
if (x <= -1.6e-8) {
tmp = t_0;
} else if (x <= 1.76e-28) {
tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606))) tmp = 0 if x <= -1.6e-8: tmp = t_0 elif x <= 1.76e-28: tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x - 2.0) * Float64(4.16438922228 + Float64(z / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606)))) tmp = 0.0 if (x <= -1.6e-8) tmp = t_0; elseif (x <= 1.76e-28) tmp = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(313.399215894 * x) + 47.066876606)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - 2.0) * (4.16438922228 + (z / (((((((x - -43.3400022514) * x) - -263.505074721) * x) - -313.399215894) * x) - -47.066876606))); tmp = 0.0; if (x <= -1.6e-8) tmp = t_0; elseif (x <= 1.76e-28) tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - 2), $MachinePrecision] * N[(104109730557/25000000000 + N[(z / N[(N[(N[(N[(N[(N[(N[(x - -216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] - -263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] - -156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] - -23533438303/500000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4835703278458517/302231454903657293676544], t$95$0, If[LessEqual[x, 7849862309882779/44601490397061246283071436545296723011960832], N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(156699607947/500000000 * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left(x - 2\right) \cdot \left(\frac{104109730557}{25000000000} + \frac{z}{\left(\left(\left(x - \frac{-216700011257}{5000000000}\right) \cdot x - \frac{-263505074721}{1000000000}\right) \cdot x - \frac{-156699607947}{500000000}\right) \cdot x - \frac{-23533438303}{500000000}}\right)\\
\mathbf{if}\;x \leq \frac{-4835703278458517}{302231454903657293676544}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq \frac{7849862309882779}{44601490397061246283071436545296723011960832}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\frac{156699607947}{500000000} \cdot x + \frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1.6000000000000001e-8 or 1.7599999999999999e-28 < x Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.0%
if -1.6000000000000001e-8 < x < 1.7599999999999999e-28Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites51.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
x
(-
104109730557/25000000000
(*
13764240537310136880149/125000000000000000000
(/ 1 x))))))
(if (<= x -5584463537939415/36028797018963968)
t_0
(if (<= x 170000000000000)
(/
(* (- x 2) (+ (* (+ (* 4297481763/31250000 x) y) x) z))
(+ (* 156699607947/500000000 x) 23533438303/500000000))
t_0))))double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -0.155) {
tmp = t_0;
} else if (x <= 1.7e+14) {
tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606);
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (4.16438922228d0 - (110.1139242984811d0 * (1.0d0 / x)))
if (x <= (-0.155d0)) then
tmp = t_0
else if (x <= 1.7d+14) then
tmp = ((x - 2.0d0) * ((((137.519416416d0 * x) + y) * x) + z)) / ((313.399215894d0 * x) + 47.066876606d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -0.155) {
tmp = t_0;
} else if (x <= 1.7e+14) {
tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))) tmp = 0 if x <= -0.155: tmp = t_0 elif x <= 1.7e+14: tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 * Float64(1.0 / x)))) tmp = 0.0 if (x <= -0.155) tmp = t_0; elseif (x <= 1.7e+14) tmp = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(137.519416416 * x) + y) * x) + z)) / Float64(Float64(313.399215894 * x) + 47.066876606)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))); tmp = 0.0; if (x <= -0.155) tmp = t_0; elseif (x <= 1.7e+14) tmp = ((x - 2.0) * ((((137.519416416 * x) + y) * x) + z)) / ((313.399215894 * x) + 47.066876606); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(104109730557/25000000000 - N[(13764240537310136880149/125000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5584463537939415/36028797018963968], t$95$0, If[LessEqual[x, 170000000000000], N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(4297481763/31250000 * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(156699607947/500000000 * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot \left(\frac{104109730557}{25000000000} - \frac{13764240537310136880149}{125000000000000000000} \cdot \frac{1}{x}\right)\\
\mathbf{if}\;x \leq \frac{-5584463537939415}{36028797018963968}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 170000000000000:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(\frac{4297481763}{31250000} \cdot x + y\right) \cdot x + z\right)}{\frac{156699607947}{500000000} \cdot x + \frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -0.155 or 1.7e14 < x Initial program 58.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6444.8%
Applied rewrites44.8%
if -0.155 < x < 1.7e14Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites51.5%
Taylor expanded in x around 0
Applied rewrites51.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
x
(-
104109730557/25000000000
(*
13764240537310136880149/125000000000000000000
(/ 1 x))))))
(if (<= x -4100000000)
t_0
(if (<= x 170000000000000)
(/
(* (- x 2) (+ (* x (+ y (* 4297481763/31250000 x))) z))
23533438303/500000000)
t_0))))double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -4100000000.0) {
tmp = t_0;
} else if (x <= 1.7e+14) {
tmp = ((x - 2.0) * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606;
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (4.16438922228d0 - (110.1139242984811d0 * (1.0d0 / x)))
if (x <= (-4100000000.0d0)) then
tmp = t_0
else if (x <= 1.7d+14) then
tmp = ((x - 2.0d0) * ((x * (y + (137.519416416d0 * x))) + z)) / 47.066876606d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -4100000000.0) {
tmp = t_0;
} else if (x <= 1.7e+14) {
tmp = ((x - 2.0) * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))) tmp = 0 if x <= -4100000000.0: tmp = t_0 elif x <= 1.7e+14: tmp = ((x - 2.0) * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 * Float64(1.0 / x)))) tmp = 0.0 if (x <= -4100000000.0) tmp = t_0; elseif (x <= 1.7e+14) tmp = Float64(Float64(Float64(x - 2.0) * Float64(Float64(x * Float64(y + Float64(137.519416416 * x))) + z)) / 47.066876606); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))); tmp = 0.0; if (x <= -4100000000.0) tmp = t_0; elseif (x <= 1.7e+14) tmp = ((x - 2.0) * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(104109730557/25000000000 - N[(13764240537310136880149/125000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4100000000], t$95$0, If[LessEqual[x, 170000000000000], N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(x * N[(y + N[(4297481763/31250000 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / 23533438303/500000000), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot \left(\frac{104109730557}{25000000000} - \frac{13764240537310136880149}{125000000000000000000} \cdot \frac{1}{x}\right)\\
\mathbf{if}\;x \leq -4100000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 170000000000000:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(x \cdot \left(y + \frac{4297481763}{31250000} \cdot x\right) + z\right)}{\frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -4.1e9 or 1.7e14 < x Initial program 58.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6444.8%
Applied rewrites44.8%
if -4.1e9 < x < 1.7e14Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites52.3%
Taylor expanded in x around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6452.2%
Applied rewrites52.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
x
(-
104109730557/25000000000
(*
13764240537310136880149/125000000000000000000
(/ 1 x))))))
(if (<= x -4800000000)
t_0
(if (<= x 1080863910568919/2251799813685248)
(/
(* -2 (+ (* x (+ y (* 4297481763/31250000 x))) z))
23533438303/500000000)
t_0))))double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -4800000000.0) {
tmp = t_0;
} else if (x <= 0.48) {
tmp = (-2.0 * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606;
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (4.16438922228d0 - (110.1139242984811d0 * (1.0d0 / x)))
if (x <= (-4800000000.0d0)) then
tmp = t_0
else if (x <= 0.48d0) then
tmp = ((-2.0d0) * ((x * (y + (137.519416416d0 * x))) + z)) / 47.066876606d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -4800000000.0) {
tmp = t_0;
} else if (x <= 0.48) {
tmp = (-2.0 * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))) tmp = 0 if x <= -4800000000.0: tmp = t_0 elif x <= 0.48: tmp = (-2.0 * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 * Float64(1.0 / x)))) tmp = 0.0 if (x <= -4800000000.0) tmp = t_0; elseif (x <= 0.48) tmp = Float64(Float64(-2.0 * Float64(Float64(x * Float64(y + Float64(137.519416416 * x))) + z)) / 47.066876606); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))); tmp = 0.0; if (x <= -4800000000.0) tmp = t_0; elseif (x <= 0.48) tmp = (-2.0 * ((x * (y + (137.519416416 * x))) + z)) / 47.066876606; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(104109730557/25000000000 - N[(13764240537310136880149/125000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4800000000], t$95$0, If[LessEqual[x, 1080863910568919/2251799813685248], N[(N[(-2 * N[(N[(x * N[(y + N[(4297481763/31250000 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / 23533438303/500000000), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot \left(\frac{104109730557}{25000000000} - \frac{13764240537310136880149}{125000000000000000000} \cdot \frac{1}{x}\right)\\
\mathbf{if}\;x \leq -4800000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq \frac{1080863910568919}{2251799813685248}:\\
\;\;\;\;\frac{-2 \cdot \left(x \cdot \left(y + \frac{4297481763}{31250000} \cdot x\right) + z\right)}{\frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -4.8e9 or 0.47999999999999998 < x Initial program 58.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6444.8%
Applied rewrites44.8%
if -4.8e9 < x < 0.47999999999999998Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites52.3%
Taylor expanded in x around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6452.2%
Applied rewrites52.2%
Taylor expanded in x around 0
Applied rewrites51.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
x
(-
104109730557/25000000000
(*
13764240537310136880149/125000000000000000000
(/ 1 x))))))
(if (<= x -4100000000)
t_0
(if (<= x 215000000000000)
(/ (* (- x 2) (+ (* x y) z)) 23533438303/500000000)
t_0))))double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -4100000000.0) {
tmp = t_0;
} else if (x <= 2.15e+14) {
tmp = ((x - 2.0) * ((x * y) + z)) / 47.066876606;
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (4.16438922228d0 - (110.1139242984811d0 * (1.0d0 / x)))
if (x <= (-4100000000.0d0)) then
tmp = t_0
else if (x <= 2.15d+14) then
tmp = ((x - 2.0d0) * ((x * y) + z)) / 47.066876606d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -4100000000.0) {
tmp = t_0;
} else if (x <= 2.15e+14) {
tmp = ((x - 2.0) * ((x * y) + z)) / 47.066876606;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))) tmp = 0 if x <= -4100000000.0: tmp = t_0 elif x <= 2.15e+14: tmp = ((x - 2.0) * ((x * y) + z)) / 47.066876606 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 * Float64(1.0 / x)))) tmp = 0.0 if (x <= -4100000000.0) tmp = t_0; elseif (x <= 2.15e+14) tmp = Float64(Float64(Float64(x - 2.0) * Float64(Float64(x * y) + z)) / 47.066876606); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))); tmp = 0.0; if (x <= -4100000000.0) tmp = t_0; elseif (x <= 2.15e+14) tmp = ((x - 2.0) * ((x * y) + z)) / 47.066876606; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(104109730557/25000000000 - N[(13764240537310136880149/125000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4100000000], t$95$0, If[LessEqual[x, 215000000000000], N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / 23533438303/500000000), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot \left(\frac{104109730557}{25000000000} - \frac{13764240537310136880149}{125000000000000000000} \cdot \frac{1}{x}\right)\\
\mathbf{if}\;x \leq -4100000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 215000000000000:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(x \cdot y + z\right)}{\frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -4.1e9 or 2.15e14 < x Initial program 58.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6444.8%
Applied rewrites44.8%
if -4.1e9 < x < 2.15e14Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites52.3%
Taylor expanded in x around 0
lower-*.f6448.9%
Applied rewrites48.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
x
(-
104109730557/25000000000
(*
13764240537310136880149/125000000000000000000
(/ 1 x))))))
(if (<= x -7800000000)
t_0
(if (<= x 29)
(+
(* -1000000000/23533438303 z)
(* -1000000000/23533438303 (* x y)))
t_0))))double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -7800000000.0) {
tmp = t_0;
} else if (x <= 29.0) {
tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y));
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (4.16438922228d0 - (110.1139242984811d0 * (1.0d0 / x)))
if (x <= (-7800000000.0d0)) then
tmp = t_0
else if (x <= 29.0d0) then
tmp = ((-0.0424927283095952d0) * z) + ((-0.0424927283095952d0) * (x * y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x)));
double tmp;
if (x <= -7800000000.0) {
tmp = t_0;
} else if (x <= 29.0) {
tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))) tmp = 0 if x <= -7800000000.0: tmp = t_0 elif x <= 29.0: tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 * Float64(1.0 / x)))) tmp = 0.0 if (x <= -7800000000.0) tmp = t_0; elseif (x <= 29.0) tmp = Float64(Float64(-0.0424927283095952 * z) + Float64(-0.0424927283095952 * Float64(x * y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (4.16438922228 - (110.1139242984811 * (1.0 / x))); tmp = 0.0; if (x <= -7800000000.0) tmp = t_0; elseif (x <= 29.0) tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(104109730557/25000000000 - N[(13764240537310136880149/125000000000000000000 * N[(1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7800000000], t$95$0, If[LessEqual[x, 29], N[(N[(-1000000000/23533438303 * z), $MachinePrecision] + N[(-1000000000/23533438303 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot \left(\frac{104109730557}{25000000000} - \frac{13764240537310136880149}{125000000000000000000} \cdot \frac{1}{x}\right)\\
\mathbf{if}\;x \leq -7800000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 29:\\
\;\;\;\;\frac{-1000000000}{23533438303} \cdot z + \frac{-1000000000}{23533438303} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -7.8e9 or 29 < x Initial program 58.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6444.8%
Applied rewrites44.8%
if -7.8e9 < x < 29Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6458.0%
Applied rewrites58.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6448.6%
Applied rewrites48.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* -1000000000/23533438303 z)
(* 104109730557/25000000000 (- x 2)))))
(if (<= x -98000)
t_0
(if (<= x 1550000000000000)
(+
(* -1000000000/23533438303 z)
(* -1000000000/23533438303 (* x y)))
t_0))))double code(double x, double y, double z) {
double t_0 = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0));
double tmp;
if (x <= -98000.0) {
tmp = t_0;
} else if (x <= 1.55e+15) {
tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y));
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((-0.0424927283095952d0) * z) + (4.16438922228d0 * (x - 2.0d0))
if (x <= (-98000.0d0)) then
tmp = t_0
else if (x <= 1.55d+15) then
tmp = ((-0.0424927283095952d0) * z) + ((-0.0424927283095952d0) * (x * y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0));
double tmp;
if (x <= -98000.0) {
tmp = t_0;
} else if (x <= 1.55e+15) {
tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0)) tmp = 0 if x <= -98000.0: tmp = t_0 elif x <= 1.55e+15: tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(-0.0424927283095952 * z) + Float64(4.16438922228 * Float64(x - 2.0))) tmp = 0.0 if (x <= -98000.0) tmp = t_0; elseif (x <= 1.55e+15) tmp = Float64(Float64(-0.0424927283095952 * z) + Float64(-0.0424927283095952 * Float64(x * y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0)); tmp = 0.0; if (x <= -98000.0) tmp = t_0; elseif (x <= 1.55e+15) tmp = (-0.0424927283095952 * z) + (-0.0424927283095952 * (x * y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-1000000000/23533438303 * z), $MachinePrecision] + N[(104109730557/25000000000 * N[(x - 2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -98000], t$95$0, If[LessEqual[x, 1550000000000000], N[(N[(-1000000000/23533438303 * z), $MachinePrecision] + N[(-1000000000/23533438303 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-1000000000}{23533438303} \cdot z + \frac{104109730557}{25000000000} \cdot \left(x - 2\right)\\
\mathbf{if}\;x \leq -98000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1550000000000000:\\
\;\;\;\;\frac{-1000000000}{23533438303} \cdot z + \frac{-1000000000}{23533438303} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -98000 or 1.55e15 < x Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6458.0%
Applied rewrites58.0%
if -98000 < x < 1.55e15Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6458.0%
Applied rewrites58.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6448.6%
Applied rewrites48.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))))
(if (<= t_0 -20000000000)
(*
(- x 2)
(+ 104109730557/25000000000 (* 500000000/23533438303 z)))
(if (<= t_0 50000000000000000)
(/ (* -2 z) 23533438303/500000000)
(+
(* -1000000000/23533438303 z)
(* 104109730557/25000000000 (- x 2)))))))double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double tmp;
if (t_0 <= -20000000000.0) {
tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z));
} else if (t_0 <= 5e+16) {
tmp = (-2.0 * z) / 47.066876606;
} else {
tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
if (t_0 <= (-20000000000.0d0)) then
tmp = (x - 2.0d0) * (4.16438922228d0 + (0.0212463641547976d0 * z))
else if (t_0 <= 5d+16) then
tmp = ((-2.0d0) * z) / 47.066876606d0
else
tmp = ((-0.0424927283095952d0) * z) + (4.16438922228d0 * (x - 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double tmp;
if (t_0 <= -20000000000.0) {
tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z));
} else if (t_0 <= 5e+16) {
tmp = (-2.0 * z) / 47.066876606;
} else {
tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0));
}
return tmp;
}
def code(x, y, z): t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606) tmp = 0 if t_0 <= -20000000000.0: tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z)) elif t_0 <= 5e+16: tmp = (-2.0 * z) / 47.066876606 else: tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) tmp = 0.0 if (t_0 <= -20000000000.0) tmp = Float64(Float64(x - 2.0) * Float64(4.16438922228 + Float64(0.0212463641547976 * z))); elseif (t_0 <= 5e+16) tmp = Float64(Float64(-2.0 * z) / 47.066876606); else tmp = Float64(Float64(-0.0424927283095952 * z) + Float64(4.16438922228 * Float64(x - 2.0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); tmp = 0.0; if (t_0 <= -20000000000.0) tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z)); elseif (t_0 <= 5e+16) tmp = (-2.0 * z) / 47.066876606; else tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -20000000000], N[(N[(x - 2), $MachinePrecision] * N[(104109730557/25000000000 + N[(500000000/23533438303 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 50000000000000000], N[(N[(-2 * z), $MachinePrecision] / 23533438303/500000000), $MachinePrecision], N[(N[(-1000000000/23533438303 * z), $MachinePrecision] + N[(104109730557/25000000000 * N[(x - 2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}}\\
\mathbf{if}\;t\_0 \leq -20000000000:\\
\;\;\;\;\left(x - 2\right) \cdot \left(\frac{104109730557}{25000000000} + \frac{500000000}{23533438303} \cdot z\right)\\
\mathbf{elif}\;t\_0 \leq 50000000000000000:\\
\;\;\;\;\frac{-2 \cdot z}{\frac{23533438303}{500000000}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1000000000}{23533438303} \cdot z + \frac{104109730557}{25000000000} \cdot \left(x - 2\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < -2e10Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6446.5%
Applied rewrites46.5%
if -2e10 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 5e16Initial program 58.7%
Taylor expanded in x around 0
Applied rewrites52.3%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
if 5e16 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6458.0%
Applied rewrites58.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))))
(if (<= t_0 -20000000000)
(*
(- x 2)
(+ 104109730557/25000000000 (* 500000000/23533438303 z)))
(if (<= t_0 50000000000000000)
(* -1000000000/23533438303 z)
(+
(* -1000000000/23533438303 z)
(* 104109730557/25000000000 (- x 2)))))))double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double tmp;
if (t_0 <= -20000000000.0) {
tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z));
} else if (t_0 <= 5e+16) {
tmp = -0.0424927283095952 * z;
} else {
tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
if (t_0 <= (-20000000000.0d0)) then
tmp = (x - 2.0d0) * (4.16438922228d0 + (0.0212463641547976d0 * z))
else if (t_0 <= 5d+16) then
tmp = (-0.0424927283095952d0) * z
else
tmp = ((-0.0424927283095952d0) * z) + (4.16438922228d0 * (x - 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double tmp;
if (t_0 <= -20000000000.0) {
tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z));
} else if (t_0 <= 5e+16) {
tmp = -0.0424927283095952 * z;
} else {
tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0));
}
return tmp;
}
def code(x, y, z): t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606) tmp = 0 if t_0 <= -20000000000.0: tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z)) elif t_0 <= 5e+16: tmp = -0.0424927283095952 * z else: tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) tmp = 0.0 if (t_0 <= -20000000000.0) tmp = Float64(Float64(x - 2.0) * Float64(4.16438922228 + Float64(0.0212463641547976 * z))); elseif (t_0 <= 5e+16) tmp = Float64(-0.0424927283095952 * z); else tmp = Float64(Float64(-0.0424927283095952 * z) + Float64(4.16438922228 * Float64(x - 2.0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); tmp = 0.0; if (t_0 <= -20000000000.0) tmp = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z)); elseif (t_0 <= 5e+16) tmp = -0.0424927283095952 * z; else tmp = (-0.0424927283095952 * z) + (4.16438922228 * (x - 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -20000000000], N[(N[(x - 2), $MachinePrecision] * N[(104109730557/25000000000 + N[(500000000/23533438303 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 50000000000000000], N[(-1000000000/23533438303 * z), $MachinePrecision], N[(N[(-1000000000/23533438303 * z), $MachinePrecision] + N[(104109730557/25000000000 * N[(x - 2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}}\\
\mathbf{if}\;t\_0 \leq -20000000000:\\
\;\;\;\;\left(x - 2\right) \cdot \left(\frac{104109730557}{25000000000} + \frac{500000000}{23533438303} \cdot z\right)\\
\mathbf{elif}\;t\_0 \leq 50000000000000000:\\
\;\;\;\;\frac{-1000000000}{23533438303} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{-1000000000}{23533438303} \cdot z + \frac{104109730557}{25000000000} \cdot \left(x - 2\right)\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < -2e10Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6446.5%
Applied rewrites46.5%
if -2e10 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 5e16Initial program 58.7%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
if 5e16 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6458.0%
Applied rewrites58.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
(- x 2)
(+ 104109730557/25000000000 (* 500000000/23533438303 z))))
(t_1
(/
(*
(- x 2)
(+
(*
(+
(*
(+
(*
(+
(* x 104109730557/25000000000)
393497462077/5000000000)
x)
4297481763/31250000)
x)
y)
x)
z))
(+
(*
(+
(*
(+
(* (+ x 216700011257/5000000000) x)
263505074721/1000000000)
x)
156699607947/500000000)
x)
23533438303/500000000))))
(if (<= t_1 -20000000000)
t_0
(if (<= t_1 50000000000000000)
(* -1000000000/23533438303 z)
t_0))))double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z));
double t_1 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double tmp;
if (t_1 <= -20000000000.0) {
tmp = t_0;
} else if (t_1 <= 5e+16) {
tmp = -0.0424927283095952 * z;
} else {
tmp = t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x - 2.0d0) * (4.16438922228d0 + (0.0212463641547976d0 * z))
t_1 = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
if (t_1 <= (-20000000000.0d0)) then
tmp = t_0
else if (t_1 <= 5d+16) then
tmp = (-0.0424927283095952d0) * z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z));
double t_1 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double tmp;
if (t_1 <= -20000000000.0) {
tmp = t_0;
} else if (t_1 <= 5e+16) {
tmp = -0.0424927283095952 * z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z)) t_1 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606) tmp = 0 if t_1 <= -20000000000.0: tmp = t_0 elif t_1 <= 5e+16: tmp = -0.0424927283095952 * z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x - 2.0) * Float64(4.16438922228 + Float64(0.0212463641547976 * z))) t_1 = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) tmp = 0.0 if (t_1 <= -20000000000.0) tmp = t_0; elseif (t_1 <= 5e+16) tmp = Float64(-0.0424927283095952 * z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - 2.0) * (4.16438922228 + (0.0212463641547976 * z)); t_1 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); tmp = 0.0; if (t_1 <= -20000000000.0) tmp = t_0; elseif (t_1 <= 5e+16) tmp = -0.0424927283095952 * z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - 2), $MachinePrecision] * N[(104109730557/25000000000 + N[(500000000/23533438303 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x - 2), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 104109730557/25000000000), $MachinePrecision] + 393497462077/5000000000), $MachinePrecision] * x), $MachinePrecision] + 4297481763/31250000), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 216700011257/5000000000), $MachinePrecision] * x), $MachinePrecision] + 263505074721/1000000000), $MachinePrecision] * x), $MachinePrecision] + 156699607947/500000000), $MachinePrecision] * x), $MachinePrecision] + 23533438303/500000000), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000000], t$95$0, If[LessEqual[t$95$1, 50000000000000000], N[(-1000000000/23533438303 * z), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := \left(x - 2\right) \cdot \left(\frac{104109730557}{25000000000} + \frac{500000000}{23533438303} \cdot z\right)\\
t_1 := \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot \frac{104109730557}{25000000000} + \frac{393497462077}{5000000000}\right) \cdot x + \frac{4297481763}{31250000}\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + \frac{216700011257}{5000000000}\right) \cdot x + \frac{263505074721}{1000000000}\right) \cdot x + \frac{156699607947}{500000000}\right) \cdot x + \frac{23533438303}{500000000}}\\
\mathbf{if}\;t\_1 \leq -20000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 50000000000000000:\\
\;\;\;\;\frac{-1000000000}{23533438303} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < -2e10 or 5e16 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 58.7%
Applied rewrites62.6%
Taylor expanded in x around inf
Applied rewrites69.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.0%
Taylor expanded in x around 0
lower-*.f6446.5%
Applied rewrites46.5%
if -2e10 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 5e16Initial program 58.7%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
(FPCore (x y z) :precision binary64 (* -1000000000/23533438303 z))
double code(double x, double y, double z) {
return -0.0424927283095952 * z;
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (-0.0424927283095952d0) * z
end function
public static double code(double x, double y, double z) {
return -0.0424927283095952 * z;
}
def code(x, y, z): return -0.0424927283095952 * z
function code(x, y, z) return Float64(-0.0424927283095952 * z) end
function tmp = code(x, y, z) tmp = -0.0424927283095952 * z; end
code[x_, y_, z_] := N[(-1000000000/23533438303 * z), $MachinePrecision]
\frac{-1000000000}{23533438303} \cdot z
Initial program 58.7%
Taylor expanded in x around 0
lower-*.f6435.7%
Applied rewrites35.7%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
:precision binary64
(/ (* (- x 2) (+ (* (+ (* (+ (* (+ (* x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+ (* (+ (* (+ (* (+ x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)))