
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
Herbie found 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
(FPCore (x y z t a)
:precision binary64
(if (<=
t
-1200000000000000010626946991786816693270672485690848906838016)
(- x (* (/ (- z y) (- a z)) (- t x)))
(if (<= t 7926335344172073/288230376151711744)
(*
x
(+ (* -1 (/ (- a y) (- z a))) (/ (* t (- z y)) (* x (- z a)))))
(134-z0z1z2z3z4 (/ -1 (- z a)) (- z y) (- x t) (- z a) x))))\begin{array}{l}
\mathbf{if}\;t \leq -1200000000000000010626946991786816693270672485690848906838016:\\
\;\;\;\;x - \frac{z - y}{a - z} \cdot \left(t - x\right)\\
\mathbf{elif}\;t \leq \frac{7926335344172073}{288230376151711744}:\\
\;\;\;\;x \cdot \left(-1 \cdot \frac{a - y}{z - a} + \frac{t \cdot \left(z - y\right)}{x \cdot \left(z - a\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{z - a}\right), \left(z - y\right), \left(x - t\right), \left(z - a\right), x\right)\\
\end{array}
if t < -1.2e60Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
mult-flip-revN/A
lift--.f64N/A
div-subN/A
sub-negateN/A
div-subN/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
Applied rewrites83.6%
if -1.2e60 < t < 0.0275Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-134-z0z1z2z3z4N/A
Applied rewrites84.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6475.1%
Applied rewrites75.1%
if 0.0275 < t Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-134-z0z1z2z3z4N/A
Applied rewrites84.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (134-z0z1z2z3z4 (/ -1 (- z a)) (- z y) (- x t) (- z a) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<=
t_2
-5617791046444737/11235582092889474423308157442431404585112356118389416079589380072358292237843810195794279832650471001320007117491962084853674360550901038905802964414967132773610493339054092829768888725077880882465817684505312860552384417646403930092119569408801702322709406917786643639996702871154982269052209770601514008576)
t_1
(if (<= t_2 0)
(+ t (* -1 (/ (- (* y (- t x)) (* a (- t x))) z)))
t_1))))\begin{array}{l}
t_1 := \mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{z - a}\right), \left(z - y\right), \left(x - t\right), \left(z - a\right), x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq \frac{-5617791046444737}{11235582092889474423308157442431404585112356118389416079589380072358292237843810195794279832650471001320007117491962084853674360550901038905802964414967132773610493339054092829768888725077880882465817684505312860552384417646403930092119569408801702322709406917786643639996702871154982269052209770601514008576}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.9999999999999998e-292 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-134-z0z1z2z3z4N/A
Applied rewrites84.5%
if -4.9999999999999998e-292 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_1 (- INFINITY))
(+ x (* (/ (- x t) (- z a)) (- y z)))
(if (<=
t_1
-5617791046444737/11235582092889474423308157442431404585112356118389416079589380072358292237843810195794279832650471001320007117491962084853674360550901038905802964414967132773610493339054092829768888725077880882465817684505312860552384417646403930092119569408801702322709406917786643639996702871154982269052209770601514008576)
t_1
(if (<= t_1 0)
(+ t (* -1 (/ (- (* y (- t x)) (* a (- t x))) z)))
(- x (* (* (/ 1 (- a z)) (- z y)) (- t x))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (((x - t) / (z - a)) * (y - z));
} else if (t_1 <= -5e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z));
} else {
tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (((x - t) / (z - a)) * (y - z));
} else if (t_1 <= -5e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z));
} else {
tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) * (t - x)) / (a - z)) tmp = 0 if t_1 <= -math.inf: tmp = x + (((x - t) / (z - a)) * (y - z)) elif t_1 <= -5e-292: tmp = t_1 elif t_1 <= 0.0: tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z)) else: tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(Float64(x - t) / Float64(z - a)) * Float64(y - z))); elseif (t_1 <= -5e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(t + Float64(-1.0 * Float64(Float64(Float64(y * Float64(t - x)) - Float64(a * Float64(t - x))) / z))); else tmp = Float64(x - Float64(Float64(Float64(1.0 / Float64(a - z)) * Float64(z - y)) * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) * (t - x)) / (a - z)); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (((x - t) / (z - a)) * (y - z)); elseif (t_1 <= -5e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z)); else tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5617791046444737/11235582092889474423308157442431404585112356118389416079589380072358292237843810195794279832650471001320007117491962084853674360550901038905802964414967132773610493339054092829768888725077880882465817684505312860552384417646403930092119569408801702322709406917786643639996702871154982269052209770601514008576], t$95$1, If[LessEqual[t$95$1, 0], N[(t + N[(-1 * N[(N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(1 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{x - t}{z - a} \cdot \left(y - z\right)\\
\mathbf{elif}\;t\_1 \leq \frac{-5617791046444737}{11235582092889474423308157442431404585112356118389416079589380072358292237843810195794279832650471001320007117491962084853674360550901038905802964414967132773610493339054092829768888725077880882465817684505312860552384417646403930092119569408801702322709406917786643639996702871154982269052209770601514008576}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \left(\frac{1}{a - z} \cdot \left(z - y\right)\right) \cdot \left(t - x\right)\\
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0Initial program 67.6%
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--.f6479.6%
Applied rewrites79.6%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.9999999999999998e-292Initial program 67.6%
if -4.9999999999999998e-292 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.4%
Applied rewrites46.4%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
mult-flip-revN/A
lift--.f64N/A
div-subN/A
sub-negateN/A
div-subN/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
Applied rewrites83.6%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
metadata-eval83.5%
Applied rewrites83.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- x t) (- z a)) (- y z))))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<=
t_2
-2291112313477997/57277807836949922408837567867349676981443478344341305058882899404622128010705808318690568531649256750858719018437999440148793721514146753400890052083129159241025748615958424204533602522957957552490080016463490494951861107213475167230717574212948590592)
t_2
(if (<= t_2 0)
(* -1 (/ (* x (- a y)) (- z a)))
(if (<=
t_2
50000000000000003960719125422883827062840959584985546704194967116721787948758551386272267278602882264876081416647209031203419106557526049419390978660438178426771560410745940876447333535260291112887354734608898565252528592034690824272687386622186778733613155375371021108230826846322688)
t_2
t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((x - t) / (z - a)) * (y - z));
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -4e-236) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -1.0 * ((x * (a - y)) / (z - a));
} else if (t_2 <= 5e+283) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((x - t) / (z - a)) * (y - z));
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -4e-236) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -1.0 * ((x * (a - y)) / (z - a));
} else if (t_2 <= 5e+283) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((x - t) / (z - a)) * (y - z)) t_2 = x + (((y - z) * (t - x)) / (a - z)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -4e-236: tmp = t_2 elif t_2 <= 0.0: tmp = -1.0 * ((x * (a - y)) / (z - a)) elif t_2 <= 5e+283: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(x - t) / Float64(z - a)) * Float64(y - z))) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -4e-236) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(-1.0 * Float64(Float64(x * Float64(a - y)) / Float64(z - a))); elseif (t_2 <= 5e+283) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((x - t) / (z - a)) * (y - z)); t_2 = x + (((y - z) * (t - x)) / (a - z)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -4e-236) tmp = t_2; elseif (t_2 <= 0.0) tmp = -1.0 * ((x * (a - y)) / (z - a)); elseif (t_2 <= 5e+283) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2291112313477997/57277807836949922408837567867349676981443478344341305058882899404622128010705808318690568531649256750858719018437999440148793721514146753400890052083129159241025748615958424204533602522957957552490080016463490494951861107213475167230717574212948590592], t$95$2, If[LessEqual[t$95$2, 0], N[(-1 * N[(N[(x * N[(a - y), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 50000000000000003960719125422883827062840959584985546704194967116721787948758551386272267278602882264876081416647209031203419106557526049419390978660438178426771560410745940876447333535260291112887354734608898565252528592034690824272687386622186778733613155375371021108230826846322688], t$95$2, t$95$1]]]]]]
\begin{array}{l}
t_1 := x + \frac{x - t}{z - a} \cdot \left(y - z\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \frac{-2291112313477997}{57277807836949922408837567867349676981443478344341305058882899404622128010705808318690568531649256750858719018437999440148793721514146753400890052083129159241025748615958424204533602522957957552490080016463490494951861107213475167230717574212948590592}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \frac{x \cdot \left(a - y\right)}{z - a}\\
\mathbf{elif}\;t\_2 \leq 50000000000000003960719125422883827062840959584985546704194967116721787948758551386272267278602882264876081416647209031203419106557526049419390978660438178426771560410745940876447333535260291112887354734608898565252528592034690824272687386622186778733613155375371021108230826846322688:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or 5.0000000000000004e283 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 67.6%
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--.f6479.6%
Applied rewrites79.6%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.0000000000000002e-236 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5.0000000000000004e283Initial program 67.6%
if -4.0000000000000002e-236 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-134-z0z1z2z3z4N/A
Applied rewrites84.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.0%
Applied rewrites39.0%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056)
(- x (* (* (/ 1 (- a z)) (- z y)) (- t x)))
(* t (- (/ y (- a z)) (/ z (- a z))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.35e+165) {
tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x));
} else {
tmp = t * ((y / (a - z)) - (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 (z <= 1.35d+165) then
tmp = x - (((1.0d0 / (a - z)) * (z - y)) * (t - x))
else
tmp = t * ((y / (a - z)) - (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 (z <= 1.35e+165) {
tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x));
} else {
tmp = t * ((y / (a - z)) - (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.35e+165: tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x)) else: tmp = t * ((y / (a - z)) - (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.35e+165) tmp = Float64(x - Float64(Float64(Float64(1.0 / Float64(a - z)) * Float64(z - y)) * Float64(t - x))); else tmp = Float64(t * Float64(Float64(y / Float64(a - z)) - Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.35e+165) tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x)); else tmp = t * ((y / (a - z)) - (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056], N[(x - N[(N[(N[(1 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056:\\
\;\;\;\;x - \left(\frac{1}{a - z} \cdot \left(z - y\right)\right) \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)\\
\end{array}
if z < 1.35e165Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
mult-flip-revN/A
lift--.f64N/A
div-subN/A
sub-negateN/A
div-subN/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
Applied rewrites83.6%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
metadata-eval83.5%
Applied rewrites83.5%
if 1.35e165 < z Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056)
(- x (* (* (/ 1 (- a z)) (- z y)) (- t x)))
(* t (/ z (- z a)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.35e+165) {
tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.35d+165) then
tmp = x - (((1.0d0 / (a - z)) * (z - y)) * (t - x))
else
tmp = t * (z / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.35e+165) {
tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.35e+165: tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x)) else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.35e+165) tmp = Float64(x - Float64(Float64(Float64(1.0 / Float64(a - z)) * Float64(z - y)) * Float64(t - x))); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.35e+165) tmp = x - (((1.0 / (a - z)) * (z - y)) * (t - x)); else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056], N[(x - N[(N[(N[(1 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056:\\
\;\;\;\;x - \left(\frac{1}{a - z} \cdot \left(z - y\right)\right) \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < 1.35e165Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
mult-flip-revN/A
lift--.f64N/A
div-subN/A
sub-negateN/A
div-subN/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
Applied rewrites83.6%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
metadata-eval83.5%
Applied rewrites83.5%
if 1.35e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056)
(- x (* (/ (- z y) (- a z)) (- t x)))
(* t (/ z (- z a)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.35e+165) {
tmp = x - (((z - y) / (a - z)) * (t - x));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.35d+165) then
tmp = x - (((z - y) / (a - z)) * (t - x))
else
tmp = t * (z / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.35e+165) {
tmp = x - (((z - y) / (a - z)) * (t - x));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.35e+165: tmp = x - (((z - y) / (a - z)) * (t - x)) else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.35e+165) tmp = Float64(x - Float64(Float64(Float64(z - y) / Float64(a - z)) * Float64(t - x))); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.35e+165) tmp = x - (((z - y) / (a - z)) * (t - x)); else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056], N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056:\\
\;\;\;\;x - \frac{z - y}{a - z} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < 1.35e165Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
mult-flip-revN/A
lift--.f64N/A
div-subN/A
sub-negateN/A
div-subN/A
frac-2neg-revN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
Applied rewrites83.6%
if 1.35e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a)
:precision binary64
(if (<=
z
1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056)
(+ x (* (/ (- x t) (- z a)) (- y z)))
(* t (/ z (- z a)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.35e+165) {
tmp = x + (((x - t) / (z - a)) * (y - z));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.35d+165) then
tmp = x + (((x - t) / (z - a)) * (y - z))
else
tmp = t * (z / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.35e+165) {
tmp = x + (((x - t) / (z - a)) * (y - z));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.35e+165: tmp = x + (((x - t) / (z - a)) * (y - z)) else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.35e+165) tmp = Float64(x + Float64(Float64(Float64(x - t) / Float64(z - a)) * Float64(y - z))); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.35e+165) tmp = x + (((x - t) / (z - a)) * (y - z)); else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056], N[(x + N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq 1349999999999999976834158306405081433468564668098450424901954640185304620606950559836587471378818037322790513692856978439889183474863931657115851209179973310853677056:\\
\;\;\;\;x + \frac{x - t}{z - a} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < 1.35e165Initial program 67.6%
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--.f6479.6%
Applied rewrites79.6%
if 1.35e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ t (- z a)) (- y z)))))
(if (<= z -18499999999999999558625001472)
t_1
(if (<=
z
6859310779502913/381072821083495145432323880589986121307201921712032611188861933548019011086397170424842053596617672260721060927906081896416989218663120764928)
(+ x (/ (* y (- t x)) (- a z)))
(if (<=
z
8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176)
t_1
(if (<=
z
6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864)
(/ y (/ (- z a) (- x t)))
(* t (/ z (- z a)))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((t / (z - a)) * (y - z));
double tmp;
if (z <= -1.85e+28) {
tmp = t_1;
} else if (z <= 1.8e-125) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 9e+120) {
tmp = t_1;
} else if (z <= 6.6e+165) {
tmp = y / ((z - a) / (x - t));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - ((t / (z - a)) * (y - z))
if (z <= (-1.85d+28)) then
tmp = t_1
else if (z <= 1.8d-125) then
tmp = x + ((y * (t - x)) / (a - z))
else if (z <= 9d+120) then
tmp = t_1
else if (z <= 6.6d+165) then
tmp = y / ((z - a) / (x - t))
else
tmp = t * (z / (z - a))
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 / (z - a)) * (y - z));
double tmp;
if (z <= -1.85e+28) {
tmp = t_1;
} else if (z <= 1.8e-125) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 9e+120) {
tmp = t_1;
} else if (z <= 6.6e+165) {
tmp = y / ((z - a) / (x - t));
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((t / (z - a)) * (y - z)) tmp = 0 if z <= -1.85e+28: tmp = t_1 elif z <= 1.8e-125: tmp = x + ((y * (t - x)) / (a - z)) elif z <= 9e+120: tmp = t_1 elif z <= 6.6e+165: tmp = y / ((z - a) / (x - t)) else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(t / Float64(z - a)) * Float64(y - z))) tmp = 0.0 if (z <= -1.85e+28) tmp = t_1; elseif (z <= 1.8e-125) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); elseif (z <= 9e+120) tmp = t_1; elseif (z <= 6.6e+165) tmp = Float64(y / Float64(Float64(z - a) / Float64(x - t))); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((t / (z - a)) * (y - z)); tmp = 0.0; if (z <= -1.85e+28) tmp = t_1; elseif (z <= 1.8e-125) tmp = x + ((y * (t - x)) / (a - z)); elseif (z <= 9e+120) tmp = t_1; elseif (z <= 6.6e+165) tmp = y / ((z - a) / (x - t)); else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -18499999999999999558625001472], t$95$1, If[LessEqual[z, 6859310779502913/381072821083495145432323880589986121307201921712032611188861933548019011086397170424842053596617672260721060927906081896416989218663120764928], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176], t$95$1, If[LessEqual[z, 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864], N[(y / N[(N[(z - a), $MachinePrecision] / N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := x - \frac{t}{z - a} \cdot \left(y - z\right)\\
\mathbf{if}\;z \leq -18499999999999999558625001472:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{6859310779502913}{381072821083495145432323880589986121307201921712032611188861933548019011086397170424842053596617672260721060927906081896416989218663120764928}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;z \leq 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864:\\
\;\;\;\;\frac{y}{\frac{z - a}{x - t}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < -1.85e28 or 1.8000000000000001e-125 < z < 8.9999999999999995e120Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
if -1.85e28 < z < 1.8000000000000001e-125Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
if 8.9999999999999995e120 < z < 6.5999999999999997e165Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6437.7%
Applied rewrites37.7%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if 6.5999999999999997e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (/ t (- z a)) (- y z)))))
(if (<= z -18499999999999999558625001472)
t_1
(if (<=
z
6859310779502913/381072821083495145432323880589986121307201921712032611188861933548019011086397170424842053596617672260721060927906081896416989218663120764928)
(+ x (/ (* y (- t x)) (- a z)))
(if (<=
z
8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176)
t_1
(if (<=
z
6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864)
(* (/ y (- z a)) (- x t))
(* t (/ z (- z a)))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((t / (z - a)) * (y - z));
double tmp;
if (z <= -1.85e+28) {
tmp = t_1;
} else if (z <= 1.8e-125) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 9e+120) {
tmp = t_1;
} else if (z <= 6.6e+165) {
tmp = (y / (z - a)) * (x - t);
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - ((t / (z - a)) * (y - z))
if (z <= (-1.85d+28)) then
tmp = t_1
else if (z <= 1.8d-125) then
tmp = x + ((y * (t - x)) / (a - z))
else if (z <= 9d+120) then
tmp = t_1
else if (z <= 6.6d+165) then
tmp = (y / (z - a)) * (x - t)
else
tmp = t * (z / (z - a))
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 / (z - a)) * (y - z));
double tmp;
if (z <= -1.85e+28) {
tmp = t_1;
} else if (z <= 1.8e-125) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 9e+120) {
tmp = t_1;
} else if (z <= 6.6e+165) {
tmp = (y / (z - a)) * (x - t);
} else {
tmp = t * (z / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((t / (z - a)) * (y - z)) tmp = 0 if z <= -1.85e+28: tmp = t_1 elif z <= 1.8e-125: tmp = x + ((y * (t - x)) / (a - z)) elif z <= 9e+120: tmp = t_1 elif z <= 6.6e+165: tmp = (y / (z - a)) * (x - t) else: tmp = t * (z / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(t / Float64(z - a)) * Float64(y - z))) tmp = 0.0 if (z <= -1.85e+28) tmp = t_1; elseif (z <= 1.8e-125) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); elseif (z <= 9e+120) tmp = t_1; elseif (z <= 6.6e+165) tmp = Float64(Float64(y / Float64(z - a)) * Float64(x - t)); else tmp = Float64(t * Float64(z / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((t / (z - a)) * (y - z)); tmp = 0.0; if (z <= -1.85e+28) tmp = t_1; elseif (z <= 1.8e-125) tmp = x + ((y * (t - x)) / (a - z)); elseif (z <= 9e+120) tmp = t_1; elseif (z <= 6.6e+165) tmp = (y / (z - a)) * (x - t); else tmp = t * (z / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -18499999999999999558625001472], t$95$1, If[LessEqual[z, 6859310779502913/381072821083495145432323880589986121307201921712032611188861933548019011086397170424842053596617672260721060927906081896416989218663120764928], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176], t$95$1, If[LessEqual[z, 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := x - \frac{t}{z - a} \cdot \left(y - z\right)\\
\mathbf{if}\;z \leq -18499999999999999558625001472:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{6859310779502913}{381072821083495145432323880589986121307201921712032611188861933548019011086397170424842053596617672260721060927906081896416989218663120764928}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;z \leq 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\
\end{array}
if z < -1.85e28 or 1.8000000000000001e-125 < z < 8.9999999999999995e120Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
if -1.85e28 < z < 1.8000000000000001e-125Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
if 8.9999999999999995e120 < z < 6.5999999999999997e165Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6437.7%
Applied rewrites37.7%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
lower-/.f6443.0%
Applied rewrites43.0%
if 6.5999999999999997e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ z (- z a)))))
(if (<= z -3399999999999999750280910337709527728652288)
t_1
(if (<=
z
4001264621376699/190536410541747572716161940294993060653600960856016305594430966774009505543198585212421026798308836130360530463953040948208494609331560382464)
(+ x (/ (* y (- t x)) (- a z)))
(if (<=
z
8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176)
(+ x (/ (* (- y z) t) (- a z)))
(if (<=
z
6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864)
(* (/ y (- z a)) (- x t))
t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = t * (z / (z - a));
double tmp;
if (z <= -3.4e+42) {
tmp = t_1;
} else if (z <= 2.1e-125) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 9e+120) {
tmp = x + (((y - z) * t) / (a - z));
} else if (z <= 6.6e+165) {
tmp = (y / (z - a)) * (x - 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 = t * (z / (z - a))
if (z <= (-3.4d+42)) then
tmp = t_1
else if (z <= 2.1d-125) then
tmp = x + ((y * (t - x)) / (a - z))
else if (z <= 9d+120) then
tmp = x + (((y - z) * t) / (a - z))
else if (z <= 6.6d+165) then
tmp = (y / (z - a)) * (x - 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 = t * (z / (z - a));
double tmp;
if (z <= -3.4e+42) {
tmp = t_1;
} else if (z <= 2.1e-125) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 9e+120) {
tmp = x + (((y - z) * t) / (a - z));
} else if (z <= 6.6e+165) {
tmp = (y / (z - a)) * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (z / (z - a)) tmp = 0 if z <= -3.4e+42: tmp = t_1 elif z <= 2.1e-125: tmp = x + ((y * (t - x)) / (a - z)) elif z <= 9e+120: tmp = x + (((y - z) * t) / (a - z)) elif z <= 6.6e+165: tmp = (y / (z - a)) * (x - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(z / Float64(z - a))) tmp = 0.0 if (z <= -3.4e+42) tmp = t_1; elseif (z <= 2.1e-125) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); elseif (z <= 9e+120) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); elseif (z <= 6.6e+165) tmp = Float64(Float64(y / Float64(z - a)) * Float64(x - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (z / (z - a)); tmp = 0.0; if (z <= -3.4e+42) tmp = t_1; elseif (z <= 2.1e-125) tmp = x + ((y * (t - x)) / (a - z)); elseif (z <= 9e+120) tmp = x + (((y - z) * t) / (a - z)); elseif (z <= 6.6e+165) tmp = (y / (z - a)) * (x - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3399999999999999750280910337709527728652288], t$95$1, If[LessEqual[z, 4001264621376699/190536410541747572716161940294993060653600960856016305594430966774009505543198585212421026798308836130360530463953040948208494609331560382464], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := t \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -3399999999999999750280910337709527728652288:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{4001264621376699}{190536410541747572716161940294993060653600960856016305594430966774009505543198585212421026798308836130360530463953040948208494609331560382464}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;z \leq 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.3999999999999998e42 or 6.5999999999999997e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
if -3.3999999999999998e42 < z < 2.1e-125Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
if 2.1e-125 < z < 8.9999999999999995e120Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
if 8.9999999999999995e120 < z < 6.5999999999999997e165Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6437.7%
Applied rewrites37.7%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
lower-/.f6443.0%
Applied rewrites43.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ z (- z a)))))
(if (<= z -3399999999999999750280910337709527728652288)
t_1
(if (<=
z
8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176)
(+ x (/ (* y (- t x)) (- a z)))
(if (<=
z
6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864)
(* (/ y (- z a)) (- x t))
t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = t * (z / (z - a));
double tmp;
if (z <= -3.4e+42) {
tmp = t_1;
} else if (z <= 9e+120) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 6.6e+165) {
tmp = (y / (z - a)) * (x - 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 = t * (z / (z - a))
if (z <= (-3.4d+42)) then
tmp = t_1
else if (z <= 9d+120) then
tmp = x + ((y * (t - x)) / (a - z))
else if (z <= 6.6d+165) then
tmp = (y / (z - a)) * (x - 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 = t * (z / (z - a));
double tmp;
if (z <= -3.4e+42) {
tmp = t_1;
} else if (z <= 9e+120) {
tmp = x + ((y * (t - x)) / (a - z));
} else if (z <= 6.6e+165) {
tmp = (y / (z - a)) * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (z / (z - a)) tmp = 0 if z <= -3.4e+42: tmp = t_1 elif z <= 9e+120: tmp = x + ((y * (t - x)) / (a - z)) elif z <= 6.6e+165: tmp = (y / (z - a)) * (x - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(z / Float64(z - a))) tmp = 0.0 if (z <= -3.4e+42) tmp = t_1; elseif (z <= 9e+120) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); elseif (z <= 6.6e+165) tmp = Float64(Float64(y / Float64(z - a)) * Float64(x - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (z / (z - a)); tmp = 0.0; if (z <= -3.4e+42) tmp = t_1; elseif (z <= 9e+120) tmp = x + ((y * (t - x)) / (a - z)); elseif (z <= 6.6e+165) tmp = (y / (z - a)) * (x - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3399999999999999750280910337709527728652288], t$95$1, If[LessEqual[z, 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := t \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -3399999999999999750280910337709527728652288:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8999999999999999533343888127788871683666634823312209064127211160441811264448253605817745403309330949040665537863982514176:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;z \leq 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.3999999999999998e42 or 6.5999999999999997e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
if -3.3999999999999998e42 < z < 8.9999999999999995e120Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
if 8.9999999999999995e120 < z < 6.5999999999999997e165Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6437.7%
Applied rewrites37.7%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
lower-/.f6443.0%
Applied rewrites43.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y (- z a)) (- x t))) (t_2 (* t (/ z (- z a)))))
(if (<= z -5400000000000000067330389781411646144512)
t_2
(if (<=
z
-5648671608315113/20173827172553973356686868531273530268200826506478308693989526222973809547006571833044104322501076808092993531037089792)
t_1
(if (<=
z
8418548055909837/59285549689505892056868344324448208820874232148807968788202283012051522375647232)
(+ x (/ (* y (- t x)) a))
(if (<=
z
6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864)
t_1
t_2))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (z - a)) * (x - t);
double t_2 = t * (z / (z - a));
double tmp;
if (z <= -5.4e+39) {
tmp = t_2;
} else if (z <= -2.8e-103) {
tmp = t_1;
} else if (z <= 1.42e-64) {
tmp = x + ((y * (t - x)) / a);
} else if (z <= 6.6e+165) {
tmp = t_1;
} else {
tmp = t_2;
}
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)) * (x - t)
t_2 = t * (z / (z - a))
if (z <= (-5.4d+39)) then
tmp = t_2
else if (z <= (-2.8d-103)) then
tmp = t_1
else if (z <= 1.42d-64) then
tmp = x + ((y * (t - x)) / a)
else if (z <= 6.6d+165) then
tmp = t_1
else
tmp = t_2
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)) * (x - t);
double t_2 = t * (z / (z - a));
double tmp;
if (z <= -5.4e+39) {
tmp = t_2;
} else if (z <= -2.8e-103) {
tmp = t_1;
} else if (z <= 1.42e-64) {
tmp = x + ((y * (t - x)) / a);
} else if (z <= 6.6e+165) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / (z - a)) * (x - t) t_2 = t * (z / (z - a)) tmp = 0 if z <= -5.4e+39: tmp = t_2 elif z <= -2.8e-103: tmp = t_1 elif z <= 1.42e-64: tmp = x + ((y * (t - x)) / a) elif z <= 6.6e+165: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(z - a)) * Float64(x - t)) t_2 = Float64(t * Float64(z / Float64(z - a))) tmp = 0.0 if (z <= -5.4e+39) tmp = t_2; elseif (z <= -2.8e-103) tmp = t_1; elseif (z <= 1.42e-64) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / a)); elseif (z <= 6.6e+165) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / (z - a)) * (x - t); t_2 = t * (z / (z - a)); tmp = 0.0; if (z <= -5.4e+39) tmp = t_2; elseif (z <= -2.8e-103) tmp = t_1; elseif (z <= 1.42e-64) tmp = x + ((y * (t - x)) / a); elseif (z <= 6.6e+165) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5400000000000000067330389781411646144512], t$95$2, If[LessEqual[z, -5648671608315113/20173827172553973356686868531273530268200826506478308693989526222973809547006571833044104322501076808092993531037089792], t$95$1, If[LessEqual[z, 8418548055909837/59285549689505892056868344324448208820874232148807968788202283012051522375647232], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := \frac{y}{z - a} \cdot \left(x - t\right)\\
t_2 := t \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -5400000000000000067330389781411646144512:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq \frac{-5648671608315113}{20173827172553973356686868531273530268200826506478308693989526222973809547006571833044104322501076808092993531037089792}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq \frac{8418548055909837}{59285549689505892056868344324448208820874232148807968788202283012051522375647232}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\
\mathbf{elif}\;z \leq 6599999999999999704889740170416960896224666331392471398596109016291223173895571176082550059814524022285304048837069830656864667679330832033829908917913588779255332864:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if z < -5.4000000000000001e39 or 6.5999999999999997e165 < z Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6430.6%
Applied rewrites30.6%
if -5.4000000000000001e39 < z < -2.8000000000000002e-103 or 1.4200000000000001e-64 < z < 6.5999999999999997e165Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6437.7%
Applied rewrites37.7%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
lower-/.f6443.0%
Applied rewrites43.0%
if -2.8000000000000002e-103 < z < 1.4200000000000001e-64Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.6%
Applied rewrites43.6%
(FPCore (x y z t a)
:precision binary64
(if (<=
y
-8330559332786147/1461501637330902918203684832716283019655932542976)
(* (/ y (- z a)) (- x t))
(if (<= y 305000000000000013664634946977792)
(+ t x)
(* (/ (- t x) (- a z)) y))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.7e-33) {
tmp = (y / (z - a)) * (x - t);
} else if (y <= 3.05e+32) {
tmp = t + x;
} else {
tmp = ((t - x) / (a - z)) * 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 (y <= (-5.7d-33)) then
tmp = (y / (z - a)) * (x - t)
else if (y <= 3.05d+32) then
tmp = t + x
else
tmp = ((t - x) / (a - z)) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.7e-33) {
tmp = (y / (z - a)) * (x - t);
} else if (y <= 3.05e+32) {
tmp = t + x;
} else {
tmp = ((t - x) / (a - z)) * y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.7e-33: tmp = (y / (z - a)) * (x - t) elif y <= 3.05e+32: tmp = t + x else: tmp = ((t - x) / (a - z)) * y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.7e-33) tmp = Float64(Float64(y / Float64(z - a)) * Float64(x - t)); elseif (y <= 3.05e+32) tmp = Float64(t + x); else tmp = Float64(Float64(Float64(t - x) / Float64(a - z)) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.7e-33) tmp = (y / (z - a)) * (x - t); elseif (y <= 3.05e+32) tmp = t + x; else tmp = ((t - x) / (a - z)) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -8330559332786147/1461501637330902918203684832716283019655932542976], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 305000000000000013664634946977792], N[(t + x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq \frac{-8330559332786147}{1461501637330902918203684832716283019655932542976}:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 305000000000000013664634946977792:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;\frac{t - x}{a - z} \cdot y\\
\end{array}
if y < -5.7000000000000003e-33Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6437.7%
Applied rewrites37.7%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
lower-/.f6443.0%
Applied rewrites43.0%
if -5.7000000000000003e-33 < y < 3.0500000000000001e32Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if 3.0500000000000001e32 < y Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.6%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y (- z a)) (- x t))))
(if (<=
y
-8330559332786147/1461501637330902918203684832716283019655932542976)
t_1
(if (<= y 305000000000000013664634946977792) (+ t x) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (z - a)) * (x - t);
double tmp;
if (y <= -5.7e-33) {
tmp = t_1;
} else if (y <= 3.05e+32) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 - a)) * (x - t)
if (y <= (-5.7d-33)) then
tmp = t_1
else if (y <= 3.05d+32) then
tmp = t + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (z - a)) * (x - t);
double tmp;
if (y <= -5.7e-33) {
tmp = t_1;
} else if (y <= 3.05e+32) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / (z - a)) * (x - t) tmp = 0 if y <= -5.7e-33: tmp = t_1 elif y <= 3.05e+32: tmp = t + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(z - a)) * Float64(x - t)) tmp = 0.0 if (y <= -5.7e-33) tmp = t_1; elseif (y <= 3.05e+32) tmp = Float64(t + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / (z - a)) * (x - t); tmp = 0.0; if (y <= -5.7e-33) tmp = t_1; elseif (y <= 3.05e+32) tmp = t + x; 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[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8330559332786147/1461501637330902918203684832716283019655932542976], t$95$1, If[LessEqual[y, 305000000000000013664634946977792], N[(t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y}{z - a} \cdot \left(x - t\right)\\
\mathbf{if}\;y \leq \frac{-8330559332786147}{1461501637330902918203684832716283019655932542976}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 305000000000000013664634946977792:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.7000000000000003e-33 or 3.0500000000000001e32 < y Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6437.7%
Applied rewrites37.7%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
lower-/.f6443.0%
Applied rewrites43.0%
if -5.7000000000000003e-33 < y < 3.0500000000000001e32Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1320000000000000000)
(+ t x)
(if (<=
a
4282608696416015/594806763391113225119224999259960224052504080663757783622308743726376262864161749418067325798462540235919489516077189220181834098217962283116332232440957850313188336178983949577074563933719094748095678312940574882427099482751152035262839576139463233204818042181657565129506139525873664)
(/ (* t (- z y)) (- z a))
(if (<=
a
21999999999999999317033377606233706984290011770878336524836782038285013611044653717164210203423579837854736449536)
(* t (- 1 (/ y z)))
(+ t x)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.32e+18) {
tmp = t + x;
} else if (a <= 7.2e-270) {
tmp = (t * (z - y)) / (z - a);
} else if (a <= 2.2e+112) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t + x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 (a <= (-1.32d+18)) then
tmp = t + x
else if (a <= 7.2d-270) then
tmp = (t * (z - y)) / (z - a)
else if (a <= 2.2d+112) then
tmp = t * (1.0d0 - (y / z))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.32e+18) {
tmp = t + x;
} else if (a <= 7.2e-270) {
tmp = (t * (z - y)) / (z - a);
} else if (a <= 2.2e+112) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.32e+18: tmp = t + x elif a <= 7.2e-270: tmp = (t * (z - y)) / (z - a) elif a <= 2.2e+112: tmp = t * (1.0 - (y / z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.32e+18) tmp = Float64(t + x); elseif (a <= 7.2e-270) tmp = Float64(Float64(t * Float64(z - y)) / Float64(z - a)); elseif (a <= 2.2e+112) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.32e+18) tmp = t + x; elseif (a <= 7.2e-270) tmp = (t * (z - y)) / (z - a); elseif (a <= 2.2e+112) tmp = t * (1.0 - (y / z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1320000000000000000], N[(t + x), $MachinePrecision], If[LessEqual[a, 4282608696416015/594806763391113225119224999259960224052504080663757783622308743726376262864161749418067325798462540235919489516077189220181834098217962283116332232440957850313188336178983949577074563933719094748095678312940574882427099482751152035262839576139463233204818042181657565129506139525873664], N[(N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 21999999999999999317033377606233706984290011770878336524836782038285013611044653717164210203423579837854736449536], N[(t * N[(1 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;a \leq -1320000000000000000:\\
\;\;\;\;t + x\\
\mathbf{elif}\;a \leq \frac{4282608696416015}{594806763391113225119224999259960224052504080663757783622308743726376262864161749418067325798462540235919489516077189220181834098217962283116332232440957850313188336178983949577074563933719094748095678312940574882427099482751152035262839576139463233204818042181657565129506139525873664}:\\
\;\;\;\;\frac{t \cdot \left(z - y\right)}{z - a}\\
\mathbf{elif}\;a \leq 21999999999999999317033377606233706984290011770878336524836782038285013611044653717164210203423579837854736449536:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
if a < -1.32e18 or 2.1999999999999999e112 < a Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if -1.32e18 < a < 7.1999999999999996e-270Initial program 67.6%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-134-z0z1z2z3z4N/A
Applied rewrites84.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.9%
Applied rewrites39.9%
if 7.1999999999999996e-270 < a < 2.1999999999999999e112Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6437.4%
Applied rewrites37.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1320000000000000000)
(+ t x)
(if (<=
a
21999999999999999317033377606233706984290011770878336524836782038285013611044653717164210203423579837854736449536)
(* t (- 1 (/ y z)))
(+ t x))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.32e+18) {
tmp = t + x;
} else if (a <= 2.2e+112) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t + x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 (a <= (-1.32d+18)) then
tmp = t + x
else if (a <= 2.2d+112) then
tmp = t * (1.0d0 - (y / z))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.32e+18) {
tmp = t + x;
} else if (a <= 2.2e+112) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.32e+18: tmp = t + x elif a <= 2.2e+112: tmp = t * (1.0 - (y / z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.32e+18) tmp = Float64(t + x); elseif (a <= 2.2e+112) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.32e+18) tmp = t + x; elseif (a <= 2.2e+112) tmp = t * (1.0 - (y / z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1320000000000000000], N[(t + x), $MachinePrecision], If[LessEqual[a, 21999999999999999317033377606233706984290011770878336524836782038285013611044653717164210203423579837854736449536], N[(t * N[(1 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -1320000000000000000:\\
\;\;\;\;t + x\\
\mathbf{elif}\;a \leq 21999999999999999317033377606233706984290011770878336524836782038285013611044653717164210203423579837854736449536:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
if a < -1.32e18 or 2.1999999999999999e112 < a Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if -1.32e18 < a < 2.1999999999999999e112Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f6437.4%
Applied rewrites37.4%
(FPCore (x y z t a)
:precision binary64
(if (<=
y
-1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528)
(* y (/ t (- a z)))
(if (<= y 305000000000000013664634946977792)
(+ t x)
(* y (/ (- x t) z)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.3e+147) {
tmp = y * (t / (a - z));
} else if (y <= 3.05e+32) {
tmp = t + x;
} else {
tmp = y * ((x - t) / z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.3d+147)) then
tmp = y * (t / (a - z))
else if (y <= 3.05d+32) then
tmp = t + x
else
tmp = y * ((x - t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.3e+147) {
tmp = y * (t / (a - z));
} else if (y <= 3.05e+32) {
tmp = t + x;
} else {
tmp = y * ((x - t) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.3e+147: tmp = y * (t / (a - z)) elif y <= 3.05e+32: tmp = t + x else: tmp = y * ((x - t) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.3e+147) tmp = Float64(y * Float64(t / Float64(a - z))); elseif (y <= 3.05e+32) tmp = Float64(t + x); else tmp = Float64(y * Float64(Float64(x - t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.3e+147) tmp = y * (t / (a - z)); elseif (y <= 3.05e+32) tmp = t + x; else tmp = y * ((x - t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 305000000000000013664634946977792], N[(t + x), $MachinePrecision], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;y \leq 305000000000000013664634946977792:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\
\end{array}
if y < -1.2999999999999999e147Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6423.4%
Applied rewrites23.4%
if -1.2999999999999999e147 < y < 3.0500000000000001e32Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if 3.0500000000000001e32 < y Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6441.7%
Applied rewrites41.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6425.6%
Applied rewrites25.6%
(FPCore (x y z t a)
:precision binary64
(if (<=
y
-1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528)
(* y (/ t (- a z)))
(if (<=
y
94999999999999994488169700123549150507398221570116778180359052610744099441334856712192)
(+ t x)
(* y (/ x (- z a))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.3e+147) {
tmp = y * (t / (a - z));
} else if (y <= 9.5e+85) {
tmp = t + x;
} else {
tmp = y * (x / (z - a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.3d+147)) then
tmp = y * (t / (a - z))
else if (y <= 9.5d+85) then
tmp = t + x
else
tmp = y * (x / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.3e+147) {
tmp = y * (t / (a - z));
} else if (y <= 9.5e+85) {
tmp = t + x;
} else {
tmp = y * (x / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.3e+147: tmp = y * (t / (a - z)) elif y <= 9.5e+85: tmp = t + x else: tmp = y * (x / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.3e+147) tmp = Float64(y * Float64(t / Float64(a - z))); elseif (y <= 9.5e+85) tmp = Float64(t + x); else tmp = Float64(y * Float64(x / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.3e+147) tmp = y * (t / (a - z)); elseif (y <= 9.5e+85) tmp = t + x; else tmp = y * (x / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 94999999999999994488169700123549150507398221570116778180359052610744099441334856712192], N[(t + x), $MachinePrecision], N[(y * N[(x / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;y \leq 94999999999999994488169700123549150507398221570116778180359052610744099441334856712192:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z - a}\\
\end{array}
if y < -1.2999999999999999e147Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6423.4%
Applied rewrites23.4%
if -1.2999999999999999e147 < y < 9.4999999999999994e85Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if 9.4999999999999994e85 < y Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6441.7%
Applied rewrites41.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower--.f6422.9%
Applied rewrites22.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ t (- a z)))))
(if (<=
y
-1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528)
t_1
(if (<= y 920000000000000017773994917407618219622006784)
(+ t x)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = y * (t / (a - z));
double tmp;
if (y <= -1.3e+147) {
tmp = t_1;
} else if (y <= 9.2e+44) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 * (t / (a - z))
if (y <= (-1.3d+147)) then
tmp = t_1
else if (y <= 9.2d+44) then
tmp = t + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (t / (a - z));
double tmp;
if (y <= -1.3e+147) {
tmp = t_1;
} else if (y <= 9.2e+44) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (t / (a - z)) tmp = 0 if y <= -1.3e+147: tmp = t_1 elif y <= 9.2e+44: tmp = t + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(t / Float64(a - z))) tmp = 0.0 if (y <= -1.3e+147) tmp = t_1; elseif (y <= 9.2e+44) tmp = Float64(t + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (t / (a - z)); tmp = 0.0; if (y <= -1.3e+147) tmp = t_1; elseif (y <= 9.2e+44) tmp = t + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528], t$95$1, If[LessEqual[y, 920000000000000017773994917407618219622006784], N[(t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := y \cdot \frac{t}{a - z}\\
\mathbf{if}\;y \leq -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 920000000000000017773994917407618219622006784:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.2999999999999999e147 or 9.2000000000000002e44 < y Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6423.4%
Applied rewrites23.4%
if -1.2999999999999999e147 < y < 9.2000000000000002e44Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- x t)) z)))
(if (<=
y
-3150000000000000064284969159874311689514361096988281839886662509860462691717156695854977457588840479124276687248905910808558607317955988038119305882107904)
t_1
(if (<=
y
11199999999999999266636761500785285580346219368070827845276274434151467108484710924288)
(+ t x)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (x - t)) / z;
double tmp;
if (y <= -3.15e+153) {
tmp = t_1;
} else if (y <= 1.12e+85) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 * (x - t)) / z
if (y <= (-3.15d+153)) then
tmp = t_1
else if (y <= 1.12d+85) then
tmp = t + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (x - t)) / z;
double tmp;
if (y <= -3.15e+153) {
tmp = t_1;
} else if (y <= 1.12e+85) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (x - t)) / z tmp = 0 if y <= -3.15e+153: tmp = t_1 elif y <= 1.12e+85: tmp = t + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(x - t)) / z) tmp = 0.0 if (y <= -3.15e+153) tmp = t_1; elseif (y <= 1.12e+85) tmp = Float64(t + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (x - t)) / z; tmp = 0.0; if (y <= -3.15e+153) tmp = t_1; elseif (y <= 1.12e+85) tmp = t + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -3150000000000000064284969159874311689514361096988281839886662509860462691717156695854977457588840479124276687248905910808558607317955988038119305882107904], t$95$1, If[LessEqual[y, 11199999999999999266636761500785285580346219368070827845276274434151467108484710924288], N[(t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y \cdot \left(x - t\right)}{z}\\
\mathbf{if}\;y \leq -3150000000000000064284969159874311689514361096988281839886662509860462691717156695854977457588840479124276687248905910808558607317955988038119305882107904:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 11199999999999999266636761500785285580346219368070827845276274434151467108484710924288:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.1500000000000001e153 or 1.1199999999999999e85 < y Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6441.7%
Applied rewrites41.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.4%
Applied rewrites23.4%
if -3.1500000000000001e153 < y < 1.1199999999999999e85Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* t y) (- a z))))
(if (<=
y
-50999999999999999913463833549768098307226747205863239969121231761549111670275507377143393897037216678997213998797862879886381730568557053240719466212871897088)
t_1
(if (<=
y
180000000000000016537542150923784084643392395473784873467797301027047301048967180400844950344295254010622589839497394619678720)
(+ t x)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = (t * y) / (a - z);
double tmp;
if (y <= -5.1e+157) {
tmp = t_1;
} else if (y <= 1.8e+125) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 * y) / (a - z)
if (y <= (-5.1d+157)) then
tmp = t_1
else if (y <= 1.8d+125) then
tmp = t + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * y) / (a - z);
double tmp;
if (y <= -5.1e+157) {
tmp = t_1;
} else if (y <= 1.8e+125) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * y) / (a - z) tmp = 0 if y <= -5.1e+157: tmp = t_1 elif y <= 1.8e+125: tmp = t + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * y) / Float64(a - z)) tmp = 0.0 if (y <= -5.1e+157) tmp = t_1; elseif (y <= 1.8e+125) tmp = Float64(t + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * y) / (a - z); tmp = 0.0; if (y <= -5.1e+157) tmp = t_1; elseif (y <= 1.8e+125) tmp = t + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -50999999999999999913463833549768098307226747205863239969121231761549111670275507377143393897037216678997213998797862879886381730568557053240719466212871897088], t$95$1, If[LessEqual[y, 180000000000000016537542150923784084643392395473784873467797301027047301048967180400844950344295254010622589839497394619678720], N[(t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t \cdot y}{a - z}\\
\mathbf{if}\;y \leq -50999999999999999913463833549768098307226747205863239969121231761549111670275507377143393897037216678997213998797862879886381730568557053240719466212871897088:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 180000000000000016537542150923784084643392395473784873467797301027047301048967180400844950344295254010622589839497394619678720:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.1e157 or 1.8000000000000002e125 < y Initial program 67.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.6%
Applied rewrites41.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.6%
Applied rewrites21.6%
if -5.1e157 < y < 1.8000000000000002e125Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y a))))
(if (<=
y
-1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528)
t_1
(if (<=
y
295000000000000004344791912536394558108844251514140744190522484346814426623697136233468449779680802677124290236833767055363244594916579383928253056153621501775798717408760314312729365944671056842509684572160)
(+ t x)
t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (y <= -1.3e+147) {
tmp = t_1;
} else if (y <= 2.95e+206) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 * (y / a)
if (y <= (-1.3d+147)) then
tmp = t_1
else if (y <= 2.95d+206) then
tmp = t + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (y <= -1.3e+147) {
tmp = t_1;
} else if (y <= 2.95e+206) {
tmp = t + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if y <= -1.3e+147: tmp = t_1 elif y <= 2.95e+206: tmp = t + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) tmp = 0.0 if (y <= -1.3e+147) tmp = t_1; elseif (y <= 2.95e+206) tmp = Float64(t + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / a); tmp = 0.0; if (y <= -1.3e+147) tmp = t_1; elseif (y <= 2.95e+206) tmp = t + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528], t$95$1, If[LessEqual[y, 295000000000000004344791912536394558108844251514140744190522484346814426623697136233468449779680802677124290236833767055363244594916579383928253056153621501775798717408760314312729365944671056842509684572160], N[(t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -1299999999999999935905125042608528024070569499276670001017534653649590958815701108287851124338230693249026350807211601062882461692784770903103766528:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 295000000000000004344791912536394558108844251514140744190522484346814426623697136233468449779680802677124290236833767055363244594916579383928253056153621501775798717408760314312729365944671056842509684572160:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.2999999999999999e147 or 2.95e206 < y Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in z around 0
lower-/.f6418.9%
Applied rewrites18.9%
if -1.2999999999999999e147 < y < 2.95e206Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
(FPCore (x y z t a)
:precision binary64
(if (<=
y
295000000000000004344791912536394558108844251514140744190522484346814426623697136233468449779680802677124290236833767055363244594916579383928253056153621501775798717408760314312729365944671056842509684572160)
(+ t x)
(/ (* t y) a)))double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.95e+206) {
tmp = t + x;
} else {
tmp = (t * y) / a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 2.95d+206) then
tmp = t + x
else
tmp = (t * y) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.95e+206) {
tmp = t + x;
} else {
tmp = (t * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 2.95e+206: tmp = t + x else: tmp = (t * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 2.95e+206) tmp = Float64(t + x); else tmp = Float64(Float64(t * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 2.95e+206) tmp = t + x; else tmp = (t * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 295000000000000004344791912536394558108844251514140744190522484346814426623697136233468449779680802677124290236833767055363244594916579383928253056153621501775798717408760314312729365944671056842509684572160], N[(t + x), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y \leq 295000000000000004344791912536394558108844251514140744190522484346814426623697136233468449779680802677124290236833767055363244594916579383928253056153621501775798717408760314312729365944671056842509684572160:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\end{array}
if y < 2.95e206Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
if 2.95e206 < y Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites55.5%
lift-+.f64N/A
add-flipN/A
sub-flipN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
Applied rewrites64.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4%
Applied rewrites52.4%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6416.6%
Applied rewrites16.6%
(FPCore (x y z t a) :precision binary64 (+ t x))
double code(double x, double y, double z, double t, double a) {
return t + x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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 = t + x
end function
public static double code(double x, double y, double z, double t, double a) {
return t + x;
}
def code(x, y, z, t, a): return t + x
function code(x, y, z, t, a) return Float64(t + x) end
function tmp = code(x, y, z, t, a) tmp = t + x; end
code[x_, y_, z_, t_, a_] := N[(t + x), $MachinePrecision]
t + x
Initial program 67.6%
Taylor expanded in z around inf
lower--.f6420.0%
Applied rewrites20.0%
Taylor expanded in x around inf
lower-*.f642.8%
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8%
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites34.3%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y z) (- t x)) (- a z))))