
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{z - a}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{z - a}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- t z) (- a z)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((t - z) / (a - z)) * 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) / (a - z)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((t - z) / (a - z)) * y);
}
def code(x, y, z, t, a): return x + (((t - z) / (a - z)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(t - z) / Float64(a - z)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((t - z) / (a - z)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
x + \frac{t - z}{a - z} \cdot y
Initial program 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.0%
Applied rewrites98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ t (- a z)) y))))
(if (<= t -4.8e-111)
t_1
(if (<= t 1.06e-55) (+ x (* (/ z (- z a)) y)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t / (a - z)) * y);
double tmp;
if (t <= -4.8e-111) {
tmp = t_1;
} else if (t <= 1.06e-55) {
tmp = x + ((z / (z - 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 - z)) * y)
if (t <= (-4.8d-111)) then
tmp = t_1
else if (t <= 1.06d-55) then
tmp = x + ((z / (z - 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 - z)) * y);
double tmp;
if (t <= -4.8e-111) {
tmp = t_1;
} else if (t <= 1.06e-55) {
tmp = x + ((z / (z - a)) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t / (a - z)) * y) tmp = 0 if t <= -4.8e-111: tmp = t_1 elif t <= 1.06e-55: tmp = x + ((z / (z - a)) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t / Float64(a - z)) * y)) tmp = 0.0 if (t <= -4.8e-111) tmp = t_1; elseif (t <= 1.06e-55) tmp = Float64(x + Float64(Float64(z / Float64(z - a)) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t / (a - z)) * y); tmp = 0.0; if (t <= -4.8e-111) tmp = t_1; elseif (t <= 1.06e-55) tmp = x + ((z / (z - 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 - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e-111], t$95$1, If[LessEqual[t, 1.06e-55], N[(x + N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{t}{a - z} \cdot y\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{-55}:\\
\;\;\;\;x + \frac{z}{z - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -4.8000000000000001e-111 or 1.06e-55 < t Initial program 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.0%
Applied rewrites98.0%
Taylor expanded in z around 0
Applied rewrites75.9%
if -4.8000000000000001e-111 < t < 1.06e-55Initial program 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.0%
Applied rewrites98.0%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
div-flipN/A
metadata-evalN/A
mul-1-negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6497.9%
Applied rewrites97.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6472.1%
Applied rewrites72.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* t y) (- a z)))))
(if (<= t -4.8e-111)
t_1
(if (<= t 1.06e-55) (+ x (* (/ z (- z a)) y)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t * y) / (a - z));
double tmp;
if (t <= -4.8e-111) {
tmp = t_1;
} else if (t <= 1.06e-55) {
tmp = x + ((z / (z - 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 * y) / (a - z))
if (t <= (-4.8d-111)) then
tmp = t_1
else if (t <= 1.06d-55) then
tmp = x + ((z / (z - 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 * y) / (a - z));
double tmp;
if (t <= -4.8e-111) {
tmp = t_1;
} else if (t <= 1.06e-55) {
tmp = x + ((z / (z - a)) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t * y) / (a - z)) tmp = 0 if t <= -4.8e-111: tmp = t_1 elif t <= 1.06e-55: tmp = x + ((z / (z - a)) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t * y) / Float64(a - z))) tmp = 0.0 if (t <= -4.8e-111) tmp = t_1; elseif (t <= 1.06e-55) tmp = Float64(x + Float64(Float64(z / Float64(z - a)) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t * y) / (a - z)); tmp = 0.0; if (t <= -4.8e-111) tmp = t_1; elseif (t <= 1.06e-55) tmp = x + ((z / (z - 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 * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e-111], t$95$1, If[LessEqual[t, 1.06e-55], N[(x + N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{t \cdot y}{a - z}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{-55}:\\
\;\;\;\;x + \frac{z}{z - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -4.8000000000000001e-111 or 1.06e-55 < t Initial program 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.0%
Applied rewrites98.0%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6472.9%
Applied rewrites72.9%
if -4.8000000000000001e-111 < t < 1.06e-55Initial program 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.0%
Applied rewrites98.0%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
div-flipN/A
metadata-evalN/A
mul-1-negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6497.9%
Applied rewrites97.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6472.1%
Applied rewrites72.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.3e+94) (+ x y) (if (<= z 1.65e+213) (+ x (/ (* t y) (- a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+94) {
tmp = x + y;
} else if (z <= 1.65e+213) {
tmp = x + ((t * y) / (a - z));
} 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 (z <= (-1.3d+94)) then
tmp = x + y
else if (z <= 1.65d+213) then
tmp = x + ((t * y) / (a - z))
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 (z <= -1.3e+94) {
tmp = x + y;
} else if (z <= 1.65e+213) {
tmp = x + ((t * y) / (a - z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+94: tmp = x + y elif z <= 1.65e+213: tmp = x + ((t * y) / (a - z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+94) tmp = Float64(x + y); elseif (z <= 1.65e+213) tmp = Float64(x + Float64(Float64(t * y) / Float64(a - z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+94) tmp = x + y; elseif (z <= 1.65e+213) tmp = x + ((t * y) / (a - z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+94], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.65e+213], N[(x + N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+94}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+213}:\\
\;\;\;\;x + \frac{t \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if z < -1.3e94 or 1.6500000000000001e213 < z Initial program 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
if -1.3e94 < z < 1.6500000000000001e213Initial program 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.0%
Applied rewrites98.0%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6472.9%
Applied rewrites72.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y (- z a)) (- z t)))
(t_2 (/ (* y (- z t)) (- z a))))
(if (<= t_2 -5e+20)
t_1
(if (<= t_2 -5e-291)
(+ x y)
(if (<= t_2 5e-172)
(+ x (/ (* t y) a))
(if (<= t_2 1e+65) (+ x y) t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (z - a)) * (z - t);
double t_2 = (y * (z - t)) / (z - a);
double tmp;
if (t_2 <= -5e+20) {
tmp = t_1;
} else if (t_2 <= -5e-291) {
tmp = x + y;
} else if (t_2 <= 5e-172) {
tmp = x + ((t * y) / a);
} else if (t_2 <= 1e+65) {
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 / (z - a)) * (z - t)
t_2 = (y * (z - t)) / (z - a)
if (t_2 <= (-5d+20)) then
tmp = t_1
else if (t_2 <= (-5d-291)) then
tmp = x + y
else if (t_2 <= 5d-172) then
tmp = x + ((t * y) / a)
else if (t_2 <= 1d+65) 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 / (z - a)) * (z - t);
double t_2 = (y * (z - t)) / (z - a);
double tmp;
if (t_2 <= -5e+20) {
tmp = t_1;
} else if (t_2 <= -5e-291) {
tmp = x + y;
} else if (t_2 <= 5e-172) {
tmp = x + ((t * y) / a);
} else if (t_2 <= 1e+65) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / (z - a)) * (z - t) t_2 = (y * (z - t)) / (z - a) tmp = 0 if t_2 <= -5e+20: tmp = t_1 elif t_2 <= -5e-291: tmp = x + y elif t_2 <= 5e-172: tmp = x + ((t * y) / a) elif t_2 <= 1e+65: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(z - a)) * Float64(z - t)) t_2 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_2 <= -5e+20) tmp = t_1; elseif (t_2 <= -5e-291) tmp = Float64(x + y); elseif (t_2 <= 5e-172) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (t_2 <= 1e+65) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / (z - a)) * (z - t); t_2 = (y * (z - t)) / (z - a); tmp = 0.0; if (t_2 <= -5e+20) tmp = t_1; elseif (t_2 <= -5e-291) tmp = x + y; elseif (t_2 <= 5e-172) tmp = x + ((t * y) / a); elseif (t_2 <= 1e+65) 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[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+20], t$95$1, If[LessEqual[t$95$2, -5e-291], N[(x + y), $MachinePrecision], If[LessEqual[t$95$2, 5e-172], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+65], N[(x + y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_1 := \frac{y}{z - a} \cdot \left(z - t\right)\\
t_2 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-291}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-172}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;t\_2 \leq 10^{+65}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5e20 or 9.9999999999999999e64 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 84.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.9%
Applied rewrites38.9%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
mult-flip-revN/A
lower-/.f6447.3%
Applied rewrites47.3%
if -5e20 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5.0000000000000003e-291 or 4.9999999999999999e-172 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.9999999999999999e64Initial program 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
if -5.0000000000000003e-291 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.9999999999999999e-172Initial program 84.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6459.6%
Applied rewrites59.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.65e+16) (+ x y) (if (<= z 1.15e+106) (+ x (* (/ t a) y)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e+16) {
tmp = x + y;
} else if (z <= 1.15e+106) {
tmp = x + ((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 (z <= (-1.65d+16)) then
tmp = x + y
else if (z <= 1.15d+106) then
tmp = x + ((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 (z <= -1.65e+16) {
tmp = x + y;
} else if (z <= 1.15e+106) {
tmp = x + ((t / a) * y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.65e+16: tmp = x + y elif z <= 1.15e+106: tmp = x + ((t / a) * y) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e+16) tmp = Float64(x + y); elseif (z <= 1.15e+106) tmp = Float64(x + Float64(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 (z <= -1.65e+16) tmp = x + y; elseif (z <= 1.15e+106) tmp = x + ((t / a) * y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e+16], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.15e+106], N[(x + N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+16}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+106}:\\
\;\;\;\;x + \frac{t}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if z < -1.65e16 or 1.1500000000000001e106 < z Initial program 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
if -1.65e16 < z < 1.1500000000000001e106Initial program 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.0%
Applied rewrites98.0%
Taylor expanded in z around 0
lower-/.f6461.4%
Applied rewrites61.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.2e-125) (+ x y) (if (<= z 390000000.0) (+ x (* (/ y a) t)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.2e-125) {
tmp = x + y;
} else if (z <= 390000000.0) {
tmp = x + ((y / 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 (z <= (-9.2d-125)) then
tmp = x + y
else if (z <= 390000000.0d0) then
tmp = x + ((y / 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 (z <= -9.2e-125) {
tmp = x + y;
} else if (z <= 390000000.0) {
tmp = x + ((y / a) * t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.2e-125: tmp = x + y elif z <= 390000000.0: tmp = x + ((y / a) * t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.2e-125) tmp = Float64(x + y); elseif (z <= 390000000.0) tmp = Float64(x + Float64(Float64(y / a) * t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.2e-125) tmp = x + y; elseif (z <= 390000000.0) tmp = x + ((y / a) * t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.2e-125], N[(x + y), $MachinePrecision], If[LessEqual[z, 390000000.0], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-125}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 390000000:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if z < -9.1999999999999996e-125 or 3.9e8 < z Initial program 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
if -9.1999999999999996e-125 < z < 3.9e8Initial program 84.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6459.6%
Applied rewrites59.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.6%
Applied rewrites61.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (- z t)))) (if (<= (/ t_1 (- z a)) 1e+65) (+ x y) (/ t_1 z))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 / (z - a)) <= 1e+65) {
tmp = x + y;
} else {
tmp = t_1 / 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) :: t_1
real(8) :: tmp
t_1 = y * (z - t)
if ((t_1 / (z - a)) <= 1d+65) then
tmp = x + y
else
tmp = t_1 / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 / (z - a)) <= 1e+65) {
tmp = x + y;
} else {
tmp = t_1 / z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) tmp = 0 if (t_1 / (z - a)) <= 1e+65: tmp = x + y else: tmp = t_1 / z return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) tmp = 0.0 if (Float64(t_1 / Float64(z - a)) <= 1e+65) tmp = Float64(x + y); else tmp = Float64(t_1 / z); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); tmp = 0.0; if ((t_1 / (z - a)) <= 1e+65) tmp = x + y; else tmp = t_1 / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision], 1e+65], N[(x + y), $MachinePrecision], N[(t$95$1 / z), $MachinePrecision]]]
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;\frac{t\_1}{z - a} \leq 10^{+65}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{z}\\
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.9999999999999999e64Initial program 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
if 9.9999999999999999e64 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 84.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.9%
Applied rewrites38.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6415.9%
Applied rewrites15.9%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6424.0%
Applied rewrites24.0%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.8e+163) (+ x y) (* (/ y (- z a)) z)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.8e+163) {
tmp = x + y;
} else {
tmp = (y / (z - a)) * 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 <= 1.8d+163) then
tmp = x + y
else
tmp = (y / (z - a)) * 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 <= 1.8e+163) {
tmp = x + y;
} else {
tmp = (y / (z - a)) * z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.8e+163: tmp = x + y else: tmp = (y / (z - a)) * z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.8e+163) tmp = Float64(x + y); else tmp = Float64(Float64(y / Float64(z - a)) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 1.8e+163) tmp = x + y; else tmp = (y / (z - a)) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.8e+163], N[(x + y), $MachinePrecision], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+163}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - a} \cdot z\\
\end{array}
if y < 1.7999999999999999e163Initial program 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
if 1.7999999999999999e163 < y Initial program 84.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.9%
Applied rewrites38.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6415.9%
Applied rewrites15.9%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
lower-*.f6422.5%
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f6422.7%
Applied rewrites22.7%
(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 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
(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 84.9%
Taylor expanded in z around inf
lower-+.f6461.2%
Applied rewrites61.2%
Taylor expanded in x around 0
Applied rewrites19.4%
herbie shell --seed 2025258
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
(+ x (/ (* y (- z t)) (- z a))))