
(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 13 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 (134-z0z1z2z3z4 (/ -1 (- z a)) y t z y)))
x + \mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{z - a}\right), y, t, z, y\right)
Initial program 86.0%
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
*-commutativeN/A
*-rgt-identityN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
sub-negateN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
remove-double-negN/A
lower-134-z0z1z2z3z4N/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f6499.8%
Applied rewrites99.8%
(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 86.0%
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.2%
Applied rewrites98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y (* (/ t z) y)))))
(if (<=
z
-4613838619036107/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
t_1
(if (<=
z
2381976568446569/340282366920938463463374607431768211456)
(- x (* (/ y a) (- z t)))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - ((t / z) * y));
double tmp;
if (z <= -3.8e-68) {
tmp = t_1;
} else if (z <= 7e-24) {
tmp = x - ((y / a) * (z - t));
} 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 + (y - ((t / z) * y))
if (z <= (-3.8d-68)) then
tmp = t_1
else if (z <= 7d-24) then
tmp = x - ((y / a) * (z - t))
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 + (y - ((t / z) * y));
double tmp;
if (z <= -3.8e-68) {
tmp = t_1;
} else if (z <= 7e-24) {
tmp = x - ((y / a) * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - ((t / z) * y)) tmp = 0 if z <= -3.8e-68: tmp = t_1 elif z <= 7e-24: tmp = x - ((y / a) * (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - Float64(Float64(t / z) * y))) tmp = 0.0 if (z <= -3.8e-68) tmp = t_1; elseif (z <= 7e-24) tmp = Float64(x - Float64(Float64(y / a) * Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - ((t / z) * y)); tmp = 0.0; if (z <= -3.8e-68) tmp = t_1; elseif (z <= 7e-24) tmp = x - ((y / a) * (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - N[(N[(t / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4613838619036107/121416805764108066932466369176469931665150427440758720078238275608681517825325531136], t$95$1, If[LessEqual[z, 2381976568446569/340282366920938463463374607431768211456], N[(x - N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \left(y - \frac{t}{z} \cdot y\right)\\
\mathbf{if}\;z \leq \frac{-4613838619036107}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{2381976568446569}{340282366920938463463374607431768211456}:\\
\;\;\;\;x - \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.8000000000000004e-68 or 6.9999999999999993e-24 < z Initial program 86.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6459.2%
Applied rewrites59.2%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
sub-flipN/A
div-addN/A
distribute-rgt-inN/A
*-inversesN/A
*-commutativeN/A
*-rgt-identityN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6467.0%
Applied rewrites67.0%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
frac-2negN/A
lower-/.f6467.0%
Applied rewrites67.0%
if -3.8000000000000004e-68 < z < 6.9999999999999993e-24Initial program 86.0%
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 0
Applied rewrites60.4%
(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
-1000000000000000057766609898115896702437267127096064137098041863234712334016924614656)
t_1
(if (<=
t_2
99999999999999990959401044767537593501656918740576398586892792465272451027953301036534141738485988029569553038510666318680865279842887243162229186843277653306392406169861934038413548670665077684456779836676898816)
(+ x (/ (* y z) (- z a)))
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 <= -1e+84) {
tmp = t_1;
} else if (t_2 <= 1e+212) {
tmp = x + ((y * z) / (z - a));
} 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 <= (-1d+84)) then
tmp = t_1
else if (t_2 <= 1d+212) then
tmp = x + ((y * z) / (z - a))
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 <= -1e+84) {
tmp = t_1;
} else if (t_2 <= 1e+212) {
tmp = x + ((y * z) / (z - a));
} 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 <= -1e+84: tmp = t_1 elif t_2 <= 1e+212: tmp = x + ((y * z) / (z - a)) 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 <= -1e+84) tmp = t_1; elseif (t_2 <= 1e+212) tmp = Float64(x + Float64(Float64(y * z) / Float64(z - a))); 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 <= -1e+84) tmp = t_1; elseif (t_2 <= 1e+212) tmp = x + ((y * z) / (z - a)); 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, -1000000000000000057766609898115896702437267127096064137098041863234712334016924614656], t$95$1, If[LessEqual[t$95$2, 99999999999999990959401044767537593501656918740576398586892792465272451027953301036534141738485988029569553038510666318680865279842887243162229186843277653306392406169861934038413548670665077684456779836676898816], N[(x + N[(N[(y * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $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 -1000000000000000057766609898115896702437267127096064137098041863234712334016924614656:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 99999999999999990959401044767537593501656918740576398586892792465272451027953301036534141738485988029569553038510666318680865279842887243162229186843277653306392406169861934038413548670665077684456779836676898816:\\
\;\;\;\;x + \frac{y \cdot z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -1.0000000000000001e84 or 9.9999999999999991e211 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 86.0%
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
lift--.f64N/A
associate-*l/N/A
lift--.f64N/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
lift--.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
if -1.0000000000000001e84 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.9999999999999991e211Initial program 86.0%
Taylor expanded in z around inf
lower-*.f6463.0%
Applied rewrites63.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y (* (/ t z) y)))))
(if (<=
z
-4735255424800215/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
t_1
(if (<=
z
5580630817503391/680564733841876926926749214863536422912)
(+ x (/ (* t y) a))
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - ((t / z) * y));
double tmp;
if (z <= -3.9e-68) {
tmp = t_1;
} else if (z <= 8.2e-24) {
tmp = x + ((t * y) / a);
} 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 + (y - ((t / z) * y))
if (z <= (-3.9d-68)) then
tmp = t_1
else if (z <= 8.2d-24) then
tmp = x + ((t * y) / a)
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 + (y - ((t / z) * y));
double tmp;
if (z <= -3.9e-68) {
tmp = t_1;
} else if (z <= 8.2e-24) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - ((t / z) * y)) tmp = 0 if z <= -3.9e-68: tmp = t_1 elif z <= 8.2e-24: tmp = x + ((t * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - Float64(Float64(t / z) * y))) tmp = 0.0 if (z <= -3.9e-68) tmp = t_1; elseif (z <= 8.2e-24) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - ((t / z) * y)); tmp = 0.0; if (z <= -3.9e-68) tmp = t_1; elseif (z <= 8.2e-24) tmp = x + ((t * y) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - N[(N[(t / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4735255424800215/121416805764108066932466369176469931665150427440758720078238275608681517825325531136], t$95$1, If[LessEqual[z, 5580630817503391/680564733841876926926749214863536422912], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \left(y - \frac{t}{z} \cdot y\right)\\
\mathbf{if}\;z \leq \frac{-4735255424800215}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{5580630817503391}{680564733841876926926749214863536422912}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.9000000000000003e-68 or 8.2000000000000003e-24 < z Initial program 86.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6459.2%
Applied rewrites59.2%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
sub-flipN/A
div-addN/A
distribute-rgt-inN/A
*-inversesN/A
*-commutativeN/A
*-rgt-identityN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6467.0%
Applied rewrites67.0%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
frac-2negN/A
lower-/.f6467.0%
Applied rewrites67.0%
if -3.9000000000000003e-68 < z < 8.2000000000000003e-24Initial program 86.0%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.0%
Applied rewrites60.0%
(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 -49999999999999998874404911728017014784)
t_1
(if (<=
t_2
390218568789499/195109284394749514461349826862072894109287383916560696928697309976585733676235351257519131441468248197489183195087913930965498479955517831643136)
(+ x (/ (* t y) a))
(if (<= t_2 200000000000000001240017290081556638990336)
(+ 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+37) {
tmp = t_1;
} else if (t_2 <= 2e-129) {
tmp = x + ((t * y) / a);
} else if (t_2 <= 2e+41) {
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+37)) then
tmp = t_1
else if (t_2 <= 2d-129) then
tmp = x + ((t * y) / a)
else if (t_2 <= 2d+41) 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+37) {
tmp = t_1;
} else if (t_2 <= 2e-129) {
tmp = x + ((t * y) / a);
} else if (t_2 <= 2e+41) {
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+37: tmp = t_1 elif t_2 <= 2e-129: tmp = x + ((t * y) / a) elif t_2 <= 2e+41: 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+37) tmp = t_1; elseif (t_2 <= 2e-129) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (t_2 <= 2e+41) 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+37) tmp = t_1; elseif (t_2 <= 2e-129) tmp = x + ((t * y) / a); elseif (t_2 <= 2e+41) 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, -49999999999999998874404911728017014784], t$95$1, If[LessEqual[t$95$2, 390218568789499/195109284394749514461349826862072894109287383916560696928697309976585733676235351257519131441468248197489183195087913930965498479955517831643136], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 200000000000000001240017290081556638990336], 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 -49999999999999998874404911728017014784:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \frac{390218568789499}{195109284394749514461349826862072894109287383916560696928697309976585733676235351257519131441468248197489183195087913930965498479955517831643136}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;t\_2 \leq 200000000000000001240017290081556638990336:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4.9999999999999999e37 or 2e41 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 86.0%
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
lift--.f64N/A
associate-*l/N/A
lift--.f64N/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
lift--.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
if -4.9999999999999999e37 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.9999999999999999e-129Initial program 86.0%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.0%
Applied rewrites60.0%
if 1.9999999999999999e-129 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e41Initial program 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
-3419097250317283/15541351137805832567355695254588151253139254712417116170014499277911234281641667985408)
(+ x y)
(if (<=
z
6628619432568335/401734511064747568885490523085290650630550748445698208825344)
(+ x (/ (* t y) a))
(+ x y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e-70) {
tmp = x + y;
} else if (z <= 1.65e-44) {
tmp = x + ((t * y) / 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 (z <= (-2.2d-70)) then
tmp = x + y
else if (z <= 1.65d-44) then
tmp = x + ((t * y) / 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 (z <= -2.2e-70) {
tmp = x + y;
} else if (z <= 1.65e-44) {
tmp = x + ((t * y) / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.2e-70: tmp = x + y elif z <= 1.65e-44: tmp = x + ((t * y) / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e-70) tmp = Float64(x + y); elseif (z <= 1.65e-44) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.2e-70) tmp = x + y; elseif (z <= 1.65e-44) tmp = x + ((t * y) / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3419097250317283/15541351137805832567355695254588151253139254712417116170014499277911234281641667985408], N[(x + y), $MachinePrecision], If[LessEqual[z, 6628619432568335/401734511064747568885490523085290650630550748445698208825344], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-3419097250317283}{15541351137805832567355695254588151253139254712417116170014499277911234281641667985408}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq \frac{6628619432568335}{401734511064747568885490523085290650630550748445698208825344}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if z < -2.1999999999999999e-70 or 1.65e-44 < z Initial program 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
if -2.1999999999999999e-70 < z < 1.65e-44Initial program 86.0%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6460.0%
Applied rewrites60.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ t (- a z)) y)))
(if (<=
t
-880000000000000000559412779227593713244479057886814510579695035987086734044415740561590042837049844683762225240309591439136464158261702650571450449034321583032430514237024259462561023866403548347498496)
t_1
(if (<=
t
420000000000000033491466275664334310586368600641076726165376733153092337212076508231651863908544757014501101358110039896911107826744981946958856260936274556070100633499712063827907696367756706977585567388591565307904)
(+ x y)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * y;
double tmp;
if (t <= -8.8e+200) {
tmp = t_1;
} else if (t <= 4.2e+215) {
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) :: tmp
t_1 = (t / (a - z)) * y
if (t <= (-8.8d+200)) then
tmp = t_1
else if (t <= 4.2d+215) 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 = (t / (a - z)) * y;
double tmp;
if (t <= -8.8e+200) {
tmp = t_1;
} else if (t <= 4.2e+215) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t / (a - z)) * y tmp = 0 if t <= -8.8e+200: tmp = t_1 elif t <= 4.2e+215: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t / Float64(a - z)) * y) tmp = 0.0 if (t <= -8.8e+200) tmp = t_1; elseif (t <= 4.2e+215) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t / (a - z)) * y; tmp = 0.0; if (t <= -8.8e+200) tmp = t_1; elseif (t <= 4.2e+215) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -880000000000000000559412779227593713244479057886814510579695035987086734044415740561590042837049844683762225240309591439136464158261702650571450449034321583032430514237024259462561023866403548347498496], t$95$1, If[LessEqual[t, 420000000000000033491466275664334310586368600641076726165376733153092337212076508231651863908544757014501101358110039896911107826744981946958856260936274556070100633499712063827907696367756706977585567388591565307904], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t}{a - z} \cdot y\\
\mathbf{if}\;t \leq -880000000000000000559412779227593713244479057886814510579695035987086734044415740561590042837049844683762225240309591439136464158261702650571450449034321583032430514237024259462561023866403548347498496:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 420000000000000033491466275664334310586368600641076726165376733153092337212076508231651863908544757014501101358110039896911107826744981946958856260936274556070100633499712063827907696367756706977585567388591565307904:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -8.8e200 or 4.2000000000000003e215 < t Initial program 86.0%
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-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6428.2%
Applied rewrites28.2%
if -8.8e200 < t < 4.2000000000000003e215Initial program 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y z) (- z t))) (t_2 (/ (* y (- z t)) (- z a))))
(if (<=
t_2
-4999999999999999702036380252676291511991648050427649115224884571969151128330931919089800127025975284687273696257534178886563745342824774058569857985872573620757200896)
t_1
(if (<=
t_2
199999999999999981918802089535075187003313837481152797173785584930544902055906602073068283476971976059139106077021332637361730559685774486324458373686555306612784812339723868076827097341330155368913559673353797632)
(+ x y)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * (z - t);
double t_2 = (y * (z - t)) / (z - a);
double tmp;
if (t_2 <= -5e+165) {
tmp = t_1;
} else if (t_2 <= 2e+212) {
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) * (z - t)
t_2 = (y * (z - t)) / (z - a)
if (t_2 <= (-5d+165)) then
tmp = t_1
else if (t_2 <= 2d+212) 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) * (z - t);
double t_2 = (y * (z - t)) / (z - a);
double tmp;
if (t_2 <= -5e+165) {
tmp = t_1;
} else if (t_2 <= 2e+212) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / z) * (z - t) t_2 = (y * (z - t)) / (z - a) tmp = 0 if t_2 <= -5e+165: tmp = t_1 elif t_2 <= 2e+212: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / z) * Float64(z - t)) t_2 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_2 <= -5e+165) tmp = t_1; elseif (t_2 <= 2e+212) 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) * (z - t); t_2 = (y * (z - t)) / (z - a); tmp = 0.0; if (t_2 <= -5e+165) tmp = t_1; elseif (t_2 <= 2e+212) 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 / z), $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, -4999999999999999702036380252676291511991648050427649115224884571969151128330931919089800127025975284687273696257534178886563745342824774058569857985872573620757200896], t$95$1, If[LessEqual[t$95$2, 199999999999999981918802089535075187003313837481152797173785584930544902055906602073068283476971976059139106077021332637361730559685774486324458373686555306612784812339723868076827097341330155368913559673353797632], N[(x + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{y}{z} \cdot \left(z - t\right)\\
t_2 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_2 \leq -4999999999999999702036380252676291511991648050427649115224884571969151128330931919089800127025975284687273696257534178886563745342824774058569857985872573620757200896:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 199999999999999981918802089535075187003313837481152797173785584930544902055906602073068283476971976059139106077021332637361730559685774486324458373686555306612784812339723868076827097341330155368913559673353797632:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4.9999999999999997e165 or 1.9999999999999998e212 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 86.0%
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
lift--.f64N/A
associate-*l/N/A
lift--.f64N/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
lift--.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
Taylor expanded in z around inf
lower-/.f6429.4%
Applied rewrites29.4%
if -4.9999999999999997e165 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.9999999999999998e212Initial program 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
-8338720222318261/94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984)
(+ x y)
(if (<=
z
-3581533965504637/188501787658138776526316391973679239907820382867140805681144220780050698265428977917842924316820804490882044531700026161400423140624345724347059987430217219443542346615871751089083876220596224387399635909565487009065232689887930358404389913798458461035797425091600762263250923357187307004059038598692050448905404416)
(* (/ t a) y)
(+ x y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.8e-212) {
tmp = x + y;
} else if (z <= -1.9e-299) {
tmp = (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 <= (-8.8d-212)) then
tmp = x + y
else if (z <= (-1.9d-299)) then
tmp = (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 <= -8.8e-212) {
tmp = x + y;
} else if (z <= -1.9e-299) {
tmp = (t / a) * y;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.8e-212: tmp = x + y elif z <= -1.9e-299: tmp = (t / a) * y else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.8e-212) tmp = Float64(x + y); elseif (z <= -1.9e-299) tmp = 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 <= -8.8e-212) tmp = x + y; elseif (z <= -1.9e-299) tmp = (t / a) * y; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8338720222318261/94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984], N[(x + y), $MachinePrecision], If[LessEqual[z, -3581533965504637/188501787658138776526316391973679239907820382867140805681144220780050698265428977917842924316820804490882044531700026161400423140624345724347059987430217219443542346615871751089083876220596224387399635909565487009065232689887930358404389913798458461035797425091600762263250923357187307004059038598692050448905404416], N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-8338720222318261}{94758184344525691842589080106353915726128296943157752144717531617800961467674370503593652882607817257720198406807316479868870852301929589321550737002025216015896910157522577243058183937475491017166931103132108688408987234729984}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq \frac{-3581533965504637}{188501787658138776526316391973679239907820382867140805681144220780050698265428977917842924316820804490882044531700026161400423140624345724347059987430217219443542346615871751089083876220596224387399635909565487009065232689887930358404389913798458461035797425091600762263250923357187307004059038598692050448905404416}:\\
\;\;\;\;\frac{t}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if z < -8.8000000000000001e-212 or -1.9000000000000001e-299 < z Initial program 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
if -8.8000000000000001e-212 < z < -1.9000000000000001e-299Initial program 86.0%
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-/.f64N/A
lower-*.f64N/A
lower--.f6426.2%
Applied rewrites26.2%
Taylor expanded in z around 0
Applied rewrites18.3%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6420.0%
Applied rewrites20.0%
(FPCore (x y z t a)
:precision binary64
(if (<=
t
-30500000000000001839805484020104823444348128865180545192617637261673060574009404931738960112376899830560556965110253586554113313658982925931389798520633018305803272215026461391437998144745576636464679944940364496896)
(/ (* y (- z t)) z)
(+ x y)))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.05e+214) {
tmp = (y * (z - t)) / 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 (t <= (-3.05d+214)) then
tmp = (y * (z - t)) / 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 (t <= -3.05e+214) {
tmp = (y * (z - t)) / z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.05e+214: tmp = (y * (z - t)) / z else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.05e+214) tmp = Float64(Float64(y * Float64(z - t)) / z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.05e+214) tmp = (y * (z - t)) / z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -30500000000000001839805484020104823444348128865180545192617637261673060574009404931738960112376899830560556965110253586554113313658982925931389798520633018305803272215026461391437998144745576636464679944940364496896], N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;t \leq -30500000000000001839805484020104823444348128865180545192617637261673060574009404931738960112376899830560556965110253586554113313658982925931389798520633018305803272215026461391437998144745576636464679944940364496896:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -3.0500000000000002e214Initial program 86.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7%
Applied rewrites39.7%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6424.3%
Applied rewrites24.3%
if -3.0500000000000002e214 < t Initial program 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(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 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
(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 86.0%
Taylor expanded in z around inf
lower-+.f6460.8%
Applied rewrites60.8%
Taylor expanded in x around 0
Applied rewrites19.0%
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, A"
:precision binary64
(+ x (/ (* y (- z t)) (- z a))))