
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{a - t}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{a - t}
(FPCore (x y z t a) :precision binary64 (+ x (134-z0z1z2z3z4 (/ -1 (- t a)) z y y t)))
x + \mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{t - a}\right), z, y, y, t\right)
Initial program 85.7%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
sub-flip-reverseN/A
lower-134-z0z1z2z3z4N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8%
Applied rewrites99.8%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- t z) (- t a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((t - z) / (t - a)) * y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((t - z) / (t - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((t - z) / (t - a)) * y);
}
def code(x, y, z, t, a): return x + (((t - z) / (t - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(t - z) / Float64(t - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((t - z) / (t - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
x + \frac{t - z}{t - a} \cdot y
Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.1%
Applied rewrites98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ t (- a t)) y))))
(if (<= t -390000)
t_1
(if (<= t 2535301200456459/158456325028528675187087900672)
(- x (* (/ z (- t a)) y))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((t / (a - t)) * y);
double tmp;
if (t <= -390000.0) {
tmp = t_1;
} else if (t <= 1.6e-14) {
tmp = x - ((z / (t - a)) * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - ((t / (a - t)) * y)
if (t <= (-390000.0d0)) then
tmp = t_1
else if (t <= 1.6d-14) then
tmp = x - ((z / (t - a)) * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((t / (a - t)) * y);
double tmp;
if (t <= -390000.0) {
tmp = t_1;
} else if (t <= 1.6e-14) {
tmp = x - ((z / (t - a)) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((t / (a - t)) * y) tmp = 0 if t <= -390000.0: tmp = t_1 elif t <= 1.6e-14: tmp = x - ((z / (t - a)) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(t / Float64(a - t)) * y)) tmp = 0.0 if (t <= -390000.0) tmp = t_1; elseif (t <= 1.6e-14) tmp = Float64(x - Float64(Float64(z / Float64(t - a)) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((t / (a - t)) * y); tmp = 0.0; if (t <= -390000.0) tmp = t_1; elseif (t <= 1.6e-14) tmp = x - ((z / (t - a)) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -390000], t$95$1, If[LessEqual[t, 2535301200456459/158456325028528675187087900672], N[(x - N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - \frac{t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -390000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq \frac{2535301200456459}{158456325028528675187087900672}:\\
\;\;\;\;x - \frac{z}{t - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.9e5 or 1.6000000000000001e-14 < t Initial program 85.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6495.8%
Applied rewrites95.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6498.1%
Applied rewrites98.1%
Taylor expanded in z around 0
Applied rewrites71.1%
if -3.9e5 < t < 1.6000000000000001e-14Initial program 85.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6495.8%
Applied rewrites95.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6473.8%
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.8%
Applied rewrites76.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3000000)
(- x (* (/ y t) (- z t)))
(if (<=
t
27999999999999998718775726159859284263970005195775618603481361310393122879981161303240436092695688073577940461915432855327377195008)
(- x (* (/ z (- t a)) y))
(+ x y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3000000.0) {
tmp = x - ((y / t) * (z - t));
} else if (t <= 2.8e+130) {
tmp = x - ((z / (t - a)) * y);
} else {
tmp = x + y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3000000.0d0)) then
tmp = x - ((y / t) * (z - t))
else if (t <= 2.8d+130) then
tmp = x - ((z / (t - a)) * y)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3000000.0) {
tmp = x - ((y / t) * (z - t));
} else if (t <= 2.8e+130) {
tmp = x - ((z / (t - a)) * y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3000000.0: tmp = x - ((y / t) * (z - t)) elif t <= 2.8e+130: tmp = x - ((z / (t - a)) * y) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3000000.0) tmp = Float64(x - Float64(Float64(y / t) * Float64(z - t))); elseif (t <= 2.8e+130) tmp = Float64(x - Float64(Float64(z / Float64(t - a)) * y)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3000000.0) tmp = x - ((y / t) * (z - t)); elseif (t <= 2.8e+130) tmp = x - ((z / (t - a)) * y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3000000], N[(x - N[(N[(y / t), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 27999999999999998718775726159859284263970005195775618603481361310393122879981161303240436092695688073577940461915432855327377195008], N[(x - N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -3000000:\\
\;\;\;\;x - \frac{y}{t} \cdot \left(z - t\right)\\
\mathbf{elif}\;t \leq 27999999999999998718775726159859284263970005195775618603481361310393122879981161303240436092695688073577940461915432855327377195008:\\
\;\;\;\;x - \frac{z}{t - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -3e6Initial program 85.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6495.8%
Applied rewrites95.8%
Taylor expanded in t around inf
lower-/.f6464.3%
Applied rewrites64.3%
if -3e6 < t < 2.7999999999999999e130Initial program 85.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6495.8%
Applied rewrites95.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6473.8%
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.8%
Applied rewrites76.8%
if 2.7999999999999999e130 < t Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2800000)
(+ x y)
(if (<=
t
27999999999999998718775726159859284263970005195775618603481361310393122879981161303240436092695688073577940461915432855327377195008)
(- x (* (/ z (- t a)) y))
(+ x y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2800000.0) {
tmp = x + y;
} else if (t <= 2.8e+130) {
tmp = x - ((z / (t - a)) * y);
} else {
tmp = x + y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2800000.0d0)) then
tmp = x + y
else if (t <= 2.8d+130) then
tmp = x - ((z / (t - a)) * y)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2800000.0) {
tmp = x + y;
} else if (t <= 2.8e+130) {
tmp = x - ((z / (t - a)) * y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2800000.0: tmp = x + y elif t <= 2.8e+130: tmp = x - ((z / (t - a)) * y) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2800000.0) tmp = Float64(x + y); elseif (t <= 2.8e+130) tmp = Float64(x - Float64(Float64(z / Float64(t - a)) * y)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2800000.0) tmp = x + y; elseif (t <= 2.8e+130) tmp = x - ((z / (t - a)) * y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2800000], N[(x + y), $MachinePrecision], If[LessEqual[t, 27999999999999998718775726159859284263970005195775618603481361310393122879981161303240436092695688073577940461915432855327377195008], N[(x - N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -2800000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 27999999999999998718775726159859284263970005195775618603481361310393122879981161303240436092695688073577940461915432855327377195008:\\
\;\;\;\;x - \frac{z}{t - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -2.8e6 or 2.7999999999999999e130 < t Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
if -2.8e6 < t < 2.7999999999999999e130Initial program 85.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6495.8%
Applied rewrites95.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6473.8%
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.8%
Applied rewrites76.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -700000)
(+ x y)
(if (<=
t
23000000000000002113798415841583634489255369458070367475338738167367743897258102483121572000025882191942560861254112410265809059840)
(+ x (/ (* y z) (- a t)))
(+ x y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -700000.0) {
tmp = x + y;
} else if (t <= 2.3e+130) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-700000.0d0)) then
tmp = x + y
else if (t <= 2.3d+130) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -700000.0) {
tmp = x + y;
} else if (t <= 2.3e+130) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -700000.0: tmp = x + y elif t <= 2.3e+130: tmp = x + ((y * z) / (a - t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -700000.0) tmp = Float64(x + y); elseif (t <= 2.3e+130) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -700000.0) tmp = x + y; elseif (t <= 2.3e+130) tmp = x + ((y * z) / (a - t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -700000], N[(x + y), $MachinePrecision], If[LessEqual[t, 23000000000000002113798415841583634489255369458070367475338738167367743897258102483121572000025882191942560861254112410265809059840], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -700000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 23000000000000002113798415841583634489255369458070367475338738167367743897258102483121572000025882191942560861254112410265809059840:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -7e5 or 2.3000000000000002e130 < t Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
if -7e5 < t < 2.3000000000000002e130Initial program 85.7%
Taylor expanded in z around inf
lower-*.f6473.8%
Applied rewrites73.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -11500)
(+ x y)
(if (<= t 8600000000000000000000)
(+ x (* (/ (- z t) a) y))
(+ x y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -11500.0) {
tmp = x + y;
} else if (t <= 8.6e+21) {
tmp = x + (((z - t) / a) * y);
} else {
tmp = x + y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-11500.0d0)) then
tmp = x + y
else if (t <= 8.6d+21) then
tmp = x + (((z - t) / a) * y)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -11500.0) {
tmp = x + y;
} else if (t <= 8.6e+21) {
tmp = x + (((z - t) / a) * y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -11500.0: tmp = x + y elif t <= 8.6e+21: tmp = x + (((z - t) / a) * y) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -11500.0) tmp = Float64(x + y); elseif (t <= 8.6e+21) tmp = Float64(x + Float64(Float64(Float64(z - t) / a) * y)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -11500.0) tmp = x + y; elseif (t <= 8.6e+21) tmp = x + (((z - t) / a) * y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -11500], N[(x + y), $MachinePrecision], If[LessEqual[t, 8600000000000000000000], N[(x + N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -11500:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 8600000000000000000000:\\
\;\;\;\;x + \frac{z - t}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -11500 or 8.6e21 < t Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
if -11500 < t < 8.6e21Initial program 85.7%
Taylor expanded in t around 0
Applied rewrites57.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6460.2%
Applied rewrites60.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y (- a t)) (- z t)))
(t_2 (/ (* y (- z t)) (- a t))))
(if (<=
t_2
-999999999999999966484112715463900049825186092620125502979674597309179755437379230686511104)
t_1
(if (<=
t_2
20240225330731/202402253307310618352495346718917307049556649764142118356901358027430339567995346891960383701437124495187077864316811911389808737385793476867013399940738509921517424276566361364466907742093216341239767678472745068562007483424692698618103355649159556340810056512358769552333414615230502532186327508646006263307707741093494784)
(+ x (/ (* y z) a))
(if (<=
t_2
4999999999999999797083622281751813657459980448242257198348695049033519614754772127580160)
(+ x y)
t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (a - t)) * (z - t);
double t_2 = (y * (z - t)) / (a - t);
double tmp;
if (t_2 <= -1e+90) {
tmp = t_1;
} else if (t_2 <= 1e-310) {
tmp = x + ((y * z) / a);
} else if (t_2 <= 5e+87) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y / (a - t)) * (z - t)
t_2 = (y * (z - t)) / (a - t)
if (t_2 <= (-1d+90)) then
tmp = t_1
else if (t_2 <= 1d-310) then
tmp = x + ((y * z) / a)
else if (t_2 <= 5d+87) then
tmp = x + y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (a - t)) * (z - t);
double t_2 = (y * (z - t)) / (a - t);
double tmp;
if (t_2 <= -1e+90) {
tmp = t_1;
} else if (t_2 <= 1e-310) {
tmp = x + ((y * z) / a);
} else if (t_2 <= 5e+87) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / (a - t)) * (z - t) t_2 = (y * (z - t)) / (a - t) tmp = 0 if t_2 <= -1e+90: tmp = t_1 elif t_2 <= 1e-310: tmp = x + ((y * z) / a) elif t_2 <= 5e+87: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(a - t)) * Float64(z - t)) t_2 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if (t_2 <= -1e+90) tmp = t_1; elseif (t_2 <= 1e-310) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t_2 <= 5e+87) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / (a - t)) * (z - t); t_2 = (y * (z - t)) / (a - t); tmp = 0.0; if (t_2 <= -1e+90) tmp = t_1; elseif (t_2 <= 1e-310) tmp = x + ((y * z) / a); elseif (t_2 <= 5e+87) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -999999999999999966484112715463900049825186092620125502979674597309179755437379230686511104], t$95$1, If[LessEqual[t$95$2, 20240225330731/202402253307310618352495346718917307049556649764142118356901358027430339567995346891960383701437124495187077864316811911389808737385793476867013399940738509921517424276566361364466907742093216341239767678472745068562007483424692698618103355649159556340810056512358769552333414615230502532186327508646006263307707741093494784], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4999999999999999797083622281751813657459980448242257198348695049033519614754772127580160], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := \frac{y}{a - t} \cdot \left(z - t\right)\\
t_2 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -999999999999999966484112715463900049825186092620125502979674597309179755437379230686511104:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \frac{20240225330731}{202402253307310618352495346718917307049556649764142118356901358027430339567995346891960383701437124495187077864316811911389808737385793476867013399940738509921517424276566361364466907742093216341239767678472745068562007483424692698618103355649159556340810056512358769552333414615230502532186327508646006263307707741093494784}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t\_2 \leq 4999999999999999797083622281751813657459980448242257198348695049033519614754772127580160:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -9.9999999999999997e89 or 4.9999999999999998e87 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 85.7%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7%
Applied rewrites39.7%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-*l/N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6447.5%
Applied rewrites47.5%
if -9.9999999999999997e89 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 9.9999999999999694e-311Initial program 85.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6459.5%
Applied rewrites59.5%
if 9.9999999999999694e-311 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 4.9999999999999998e87Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -590000)
(+ x y)
(if (<= t 4951760157141521/2475880078570760549798248448)
(+ x (/ (* y z) a))
(+ x y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -590000.0) {
tmp = x + y;
} else if (t <= 2e-12) {
tmp = x + ((y * z) / a);
} else {
tmp = x + y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-590000.0d0)) then
tmp = x + y
else if (t <= 2d-12) then
tmp = x + ((y * z) / a)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -590000.0) {
tmp = x + y;
} else if (t <= 2e-12) {
tmp = x + ((y * z) / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -590000.0: tmp = x + y elif t <= 2e-12: tmp = x + ((y * z) / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -590000.0) tmp = Float64(x + y); elseif (t <= 2e-12) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -590000.0) tmp = x + y; elseif (t <= 2e-12) tmp = x + ((y * z) / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -590000], N[(x + y), $MachinePrecision], If[LessEqual[t, 4951760157141521/2475880078570760549798248448], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -590000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq \frac{4951760157141521}{2475880078570760549798248448}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -5.9e5 or 2e-12 < t Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
if -5.9e5 < t < 2e-12Initial program 85.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6459.5%
Applied rewrites59.5%
(FPCore (x y z t a)
:precision binary64
(if (<=
(/ (* y (- z t)) (- a t))
49999999999999999884518512257185400348306273996201919460278431983048793274064838238955966239342592)
(+ x y)
(* (/ y (- a t)) z)))double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / (a - t)) <= 5e+97) {
tmp = x + y;
} else {
tmp = (y / (a - t)) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((y * (z - t)) / (a - t)) <= 5d+97) then
tmp = x + y
else
tmp = (y / (a - t)) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / (a - t)) <= 5e+97) {
tmp = x + y;
} else {
tmp = (y / (a - t)) * z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((y * (z - t)) / (a - t)) <= 5e+97: tmp = x + y else: tmp = (y / (a - t)) * z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(y * Float64(z - t)) / Float64(a - t)) <= 5e+97) tmp = Float64(x + y); else tmp = Float64(Float64(y / Float64(a - t)) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((y * (z - t)) / (a - t)) <= 5e+97) tmp = x + y; else tmp = (y / (a - t)) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], 49999999999999999884518512257185400348306273996201919460278431983048793274064838238955966239342592], N[(x + y), $MachinePrecision], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 49999999999999999884518512257185400348306273996201919460278431983048793274064838238955966239342592:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - t} \cdot z\\
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 5e97Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
if 5e97 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.7%
Applied rewrites26.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6429.0%
Applied rewrites29.0%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6429.0%
Applied rewrites29.0%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
195000000000000013423086018547400826322037102352529376490127476942746493577204858317007062682042928858068800774948149770500210948420271766960380875352257810703753010192511781284796122612829243604576830292428928369807154637679269281644300321474793929847322181632)
(+ x y)
(/ (* y z) a)))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.95e+260) {
tmp = x + y;
} else {
tmp = (y * z) / a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.95d+260) then
tmp = x + y
else
tmp = (y * z) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.95e+260) {
tmp = x + y;
} else {
tmp = (y * z) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.95e+260: tmp = x + y else: tmp = (y * z) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.95e+260) tmp = Float64(x + y); else tmp = Float64(Float64(y * z) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.95e+260) tmp = x + y; else tmp = (y * z) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 195000000000000013423086018547400826322037102352529376490127476942746493577204858317007062682042928858068800774948149770500210948420271766960380875352257810703753010192511781284796122612829243604576830292428928369807154637679269281644300321474793929847322181632], N[(x + y), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq 195000000000000013423086018547400826322037102352529376490127476942746493577204858317007062682042928858068800774948149770500210948420271766960380875352257810703753010192511781284796122612829243604576830292428928369807154637679269281644300321474793929847322181632:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\end{array}
if z < 1.9500000000000001e260Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
if 1.9500000000000001e260 < z Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.7%
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites18.4%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
195000000000000013423086018547400826322037102352529376490127476942746493577204858317007062682042928858068800774948149770500210948420271766960380875352257810703753010192511781284796122612829243604576830292428928369807154637679269281644300321474793929847322181632)
(+ x y)
(* (/ z a) y)))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.95e+260) {
tmp = x + y;
} else {
tmp = (z / a) * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.95d+260) then
tmp = x + y
else
tmp = (z / a) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.95e+260) {
tmp = x + y;
} else {
tmp = (z / a) * y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.95e+260: tmp = x + y else: tmp = (z / a) * y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.95e+260) tmp = Float64(x + y); else tmp = Float64(Float64(z / a) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.95e+260) tmp = x + y; else tmp = (z / a) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 195000000000000013423086018547400826322037102352529376490127476942746493577204858317007062682042928858068800774948149770500210948420271766960380875352257810703753010192511781284796122612829243604576830292428928369807154637679269281644300321474793929847322181632], N[(x + y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq 195000000000000013423086018547400826322037102352529376490127476942746493577204858317007062682042928858068800774948149770500210948420271766960380875352257810703753010192511781284796122612829243604576830292428928369807154637679269281644300321474793929847322181632:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\end{array}
if z < 1.9500000000000001e260Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
if 1.9500000000000001e260 < z Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6426.7%
Applied rewrites26.7%
Taylor expanded in t around 0
Applied rewrites18.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6420.2%
Applied rewrites20.2%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
x + y
Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
(FPCore (x y z t a) :precision binary64 y)
double code(double x, double y, double z, double t, double a) {
return y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y
end function
public static double code(double x, double y, double z, double t, double a) {
return y;
}
def code(x, y, z, t, a): return y
function code(x, y, z, t, a) return y end
function tmp = code(x, y, z, t, a) tmp = y; end
code[x_, y_, z_, t_, a_] := y
y
Initial program 85.7%
Taylor expanded in t around inf
lower-+.f6459.4%
Applied rewrites59.4%
Taylor expanded in x around 0
Applied rewrites18.3%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
(+ x (/ (* y (- z t)) (- a t))))