
(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]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Herbie found 20 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]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+180)
(fma (- x t) (/ (- y a) z) t)
(if (<= z -8.8e-197)
(fma (/ (- z y) (- z a)) (- t x) x)
(if (<= z 1.18e+51)
(fma (/ (- x t) (- z a)) (- y z) x)
(fma (/ (- t x) z) (- a y) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+180) {
tmp = fma((x - t), ((y - a) / z), t);
} else if (z <= -8.8e-197) {
tmp = fma(((z - y) / (z - a)), (t - x), x);
} else if (z <= 1.18e+51) {
tmp = fma(((x - t) / (z - a)), (y - z), x);
} else {
tmp = fma(((t - x) / z), (a - y), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+180) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); elseif (z <= -8.8e-197) tmp = fma(Float64(Float64(z - y) / Float64(z - a)), Float64(t - x), x); elseif (z <= 1.18e+51) tmp = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x); else tmp = fma(Float64(Float64(t - x) / z), Float64(a - y), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+180], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -8.8e-197], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.18e+51], N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-197}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - y}{z - a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\end{array}
\end{array}
if z < -6.59999999999999978e180Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
Applied rewrites52.9%
if -6.59999999999999978e180 < z < -8.8000000000000001e-197Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/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--.f6484.2
Applied rewrites84.2%
if -8.8000000000000001e-197 < z < 1.18e51Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.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--.f6480.4
Applied rewrites80.4%
if 1.18e51 < z Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negateN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-fma.f64N/A
Applied rewrites51.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.9e+164)
(fma (- x t) (/ (- y a) z) t)
(if (<= z 1.18e+51)
(fma (/ (- x t) (- z a)) (- y z) x)
(fma (/ (- t x) z) (- a y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.9e+164) {
tmp = fma((x - t), ((y - a) / z), t);
} else if (z <= 1.18e+51) {
tmp = fma(((x - t) / (z - a)), (y - z), x);
} else {
tmp = fma(((t - x) / z), (a - y), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.9e+164) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); elseif (z <= 1.18e+51) tmp = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x); else tmp = fma(Float64(Float64(t - x) / z), Float64(a - y), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.9e+164], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 1.18e+51], N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\end{array}
\end{array}
if z < -3.89999999999999985e164Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
Applied rewrites52.9%
if -3.89999999999999985e164 < z < 1.18e51Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.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--.f6480.4
Applied rewrites80.4%
if 1.18e51 < z Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negateN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-fma.f64N/A
Applied rewrites51.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.8e+180)
(fma (- x t) (/ (- y a) z) t)
(if (<= z -2.25e-116)
(fma (/ (- y z) (- a z)) t x)
(if (<= z 1.55e-31)
(+ x (/ (* y (- t x)) (- a z)))
(fma (/ (- t x) z) (- a y) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+180) {
tmp = fma((x - t), ((y - a) / z), t);
} else if (z <= -2.25e-116) {
tmp = fma(((y - z) / (a - z)), t, x);
} else if (z <= 1.55e-31) {
tmp = x + ((y * (t - x)) / (a - z));
} else {
tmp = fma(((t - x) / z), (a - y), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+180) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); elseif (z <= -2.25e-116) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), t, x); elseif (z <= 1.55e-31) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); else tmp = fma(Float64(Float64(t - x) / z), Float64(a - y), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+180], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -2.25e-116], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 1.55e-31], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-116}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-31}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\end{array}
\end{array}
if z < -5.80000000000000015e180Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
Applied rewrites52.9%
if -5.80000000000000015e180 < z < -2.25000000000000006e-116Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites56.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6467.7
Applied rewrites67.7%
if -2.25000000000000006e-116 < z < 1.55e-31Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6455.5
Applied rewrites55.5%
if 1.55e-31 < z Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negateN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-fma.f64N/A
Applied rewrites51.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2e-18)
(fma (/ (- y z) (- a z)) t x)
(if (<= a 4.5e+70)
(fma (- x t) (/ (- y a) z) t)
(fma (/ t (- z a)) (- z y) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e-18) {
tmp = fma(((y - z) / (a - z)), t, x);
} else if (a <= 4.5e+70) {
tmp = fma((x - t), ((y - a) / z), t);
} else {
tmp = fma((t / (z - a)), (z - y), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e-18) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), t, x); elseif (a <= 4.5e+70) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); else tmp = fma(Float64(t / Float64(z - a)), Float64(z - y), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e-18], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[a, 4.5e+70], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z - a}, z - y, x\right)\\
\end{array}
\end{array}
if a < -2.0000000000000001e-18Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites56.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6467.7
Applied rewrites67.7%
if -2.0000000000000001e-18 < a < 4.4999999999999999e70Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
Applied rewrites52.9%
if 4.4999999999999999e70 < a Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites56.8%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites64.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t (- z a)) (- z y) x)))
(if (<= a -2e-18)
t_1
(if (<= a 4.5e+70) (fma (- x t) (/ (- y a) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / (z - a)), (z - y), x);
double tmp;
if (a <= -2e-18) {
tmp = t_1;
} else if (a <= 4.5e+70) {
tmp = fma((x - t), ((y - a) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / Float64(z - a)), Float64(z - y), x) tmp = 0.0 if (a <= -2e-18) tmp = t_1; elseif (a <= 4.5e+70) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2e-18], t$95$1, If[LessEqual[a, 4.5e+70], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{z - a}, z - y, x\right)\\
\mathbf{if}\;a \leq -2 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.0000000000000001e-18 or 4.4999999999999999e70 < a Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites56.8%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites64.8%
if -2.0000000000000001e-18 < a < 4.4999999999999999e70Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
Applied rewrites52.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.2e-61) (fma (- x t) (/ (- y a) z) t) (if (<= z 1.5e-31) (fma (/ y a) (- t x) x) (fma (/ (- t x) z) (- a y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e-61) {
tmp = fma((x - t), ((y - a) / z), t);
} else if (z <= 1.5e-31) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = fma(((t - x) / z), (a - y), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e-61) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); elseif (z <= 1.5e-31) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = fma(Float64(Float64(t - x) / z), Float64(a - y), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e-61], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 1.5e-31], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\end{array}
\end{array}
if z < -5.20000000000000021e-61Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
Applied rewrites52.9%
if -5.20000000000000021e-61 < z < 1.49999999999999991e-31Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/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--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around 0
lower-/.f6449.1
Applied rewrites49.1%
if 1.49999999999999991e-31 < z Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negateN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-fma.f64N/A
Applied rewrites51.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- x t) (/ (- y a) z) t))) (if (<= z -5.2e-61) t_1 (if (<= z 1.5e-31) (fma (/ y a) (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - t), ((y - a) / z), t);
double tmp;
if (z <= -5.2e-61) {
tmp = t_1;
} else if (z <= 1.5e-31) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - t), Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -5.2e-61) tmp = t_1; elseif (z <= 1.5e-31) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -5.2e-61], t$95$1, If[LessEqual[z, 1.5e-31], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.20000000000000021e-61 or 1.49999999999999991e-31 < z Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
Applied rewrites52.9%
if -5.20000000000000021e-61 < z < 1.49999999999999991e-31Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/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--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around 0
lower-/.f6449.1
Applied rewrites49.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (/ (* a (- t x)) z))))
(if (<= z -6.5e+86)
t_1
(if (<= z 9.2e-14)
(fma (/ y a) (- t x) x)
(if (<= z 1.45e+238) (/ (* t (- y z)) (- a z)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((a * (t - x)) / z);
double tmp;
if (z <= -6.5e+86) {
tmp = t_1;
} else if (z <= 9.2e-14) {
tmp = fma((y / a), (t - x), x);
} else if (z <= 1.45e+238) {
tmp = (t * (y - z)) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(a * Float64(t - x)) / z)) tmp = 0.0 if (z <= -6.5e+86) tmp = t_1; elseif (z <= 9.2e-14) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (z <= 1.45e+238) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+86], t$95$1, If[LessEqual[z, 9.2e-14], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.45e+238], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \frac{a \cdot \left(t - x\right)}{z}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+238}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.49999999999999996e86 or 1.4500000000000001e238 < z Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
if -6.49999999999999996e86 < z < 9.19999999999999993e-14Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/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--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around 0
lower-/.f6449.1
Applied rewrites49.1%
if 9.19999999999999993e-14 < z < 1.4500000000000001e238Initial program 69.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.4e+88) (+ x (- t x)) (if (<= z 9.2e-14) (fma (/ y a) (- t x) x) (/ (* t (- y z)) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e+88) {
tmp = x + (t - x);
} else if (z <= 9.2e-14) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = (t * (y - z)) / (a - z);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.4e+88) tmp = Float64(x + Float64(t - x)); elseif (z <= 9.2e-14) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e+88], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-14], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+88}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\end{array}
\end{array}
if z < -6.3999999999999997e88Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -6.3999999999999997e88 < z < 9.19999999999999993e-14Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/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--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around 0
lower-/.f6449.1
Applied rewrites49.1%
if 9.19999999999999993e-14 < z Initial program 69.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y a) (- t x) x)))
(if (<= a -2.25e-67)
t_1
(if (<= a 20500000.0) (* (/ (- x t) (- z a)) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / a), (t - x), x);
double tmp;
if (a <= -2.25e-67) {
tmp = t_1;
} else if (a <= 20500000.0) {
tmp = ((x - t) / (z - a)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / a), Float64(t - x), x) tmp = 0.0 if (a <= -2.25e-67) tmp = t_1; elseif (a <= 20500000.0) tmp = Float64(Float64(Float64(x - t) / Float64(z - a)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.25e-67], t$95$1, If[LessEqual[a, 20500000.0], N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -2.25 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 20500000:\\
\;\;\;\;\frac{x - t}{z - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.25000000000000008e-67 or 2.05e7 < a Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/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--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around 0
lower-/.f6449.1
Applied rewrites49.1%
if -2.25000000000000008e-67 < a < 2.05e7Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.3
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6441.6
Applied rewrites41.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- t x)))) (if (<= z -6.4e+88) t_1 (if (<= z 4.2e+42) (fma (/ y a) (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -6.4e+88) {
tmp = t_1;
} else if (z <= 4.2e+42) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -6.4e+88) tmp = t_1; elseif (z <= 4.2e+42) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+88], t$95$1, If[LessEqual[z, 4.2e+42], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.3999999999999997e88 or 4.19999999999999991e42 < z Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -6.3999999999999997e88 < z < 4.19999999999999991e42Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/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--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around 0
lower-/.f6449.1
Applied rewrites49.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -2.9e+78)
t_1
(if (<= z -3.2e-155)
(* y (/ (- x t) z))
(if (<= z 2.15e-19) (* y (/ (- t x) a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -2.9e+78) {
tmp = t_1;
} else if (z <= -3.2e-155) {
tmp = y * ((x - t) / z);
} else if (z <= 2.15e-19) {
tmp = y * ((t - x) / a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t - x)
if (z <= (-2.9d+78)) then
tmp = t_1
else if (z <= (-3.2d-155)) then
tmp = y * ((x - t) / z)
else if (z <= 2.15d-19) then
tmp = y * ((t - x) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -2.9e+78) {
tmp = t_1;
} else if (z <= -3.2e-155) {
tmp = y * ((x - t) / z);
} else if (z <= 2.15e-19) {
tmp = y * ((t - x) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -2.9e+78: tmp = t_1 elif z <= -3.2e-155: tmp = y * ((x - t) / z) elif z <= 2.15e-19: tmp = y * ((t - x) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -2.9e+78) tmp = t_1; elseif (z <= -3.2e-155) tmp = Float64(y * Float64(Float64(x - t) / z)); elseif (z <= 2.15e-19) tmp = Float64(y * Float64(Float64(t - x) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -2.9e+78) tmp = t_1; elseif (z <= -3.2e-155) tmp = y * ((x - t) / z); elseif (z <= 2.15e-19) tmp = y * ((t - x) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+78], t$95$1, If[LessEqual[z, -3.2e-155], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-19], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-155}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-19}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.90000000000000017e78 or 2.15e-19 < z Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -2.90000000000000017e78 < z < -3.20000000000000013e-155Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
div-flipN/A
lower-special-/.f64N/A
lower-special-/.f64N/A
lower--.f6441.4
Applied rewrites41.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
if -3.20000000000000013e-155 < z < 2.15e-19Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6425.2
Applied rewrites25.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -2.75e+78)
t_1
(if (<= z -1.95e-156)
(/ (* y (- x t)) z)
(if (<= z 2.15e-19) (* y (/ (- t x) a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -2.75e+78) {
tmp = t_1;
} else if (z <= -1.95e-156) {
tmp = (y * (x - t)) / z;
} else if (z <= 2.15e-19) {
tmp = y * ((t - x) / a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t - x)
if (z <= (-2.75d+78)) then
tmp = t_1
else if (z <= (-1.95d-156)) then
tmp = (y * (x - t)) / z
else if (z <= 2.15d-19) then
tmp = y * ((t - x) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -2.75e+78) {
tmp = t_1;
} else if (z <= -1.95e-156) {
tmp = (y * (x - t)) / z;
} else if (z <= 2.15e-19) {
tmp = y * ((t - x) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -2.75e+78: tmp = t_1 elif z <= -1.95e-156: tmp = (y * (x - t)) / z elif z <= 2.15e-19: tmp = y * ((t - x) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -2.75e+78) tmp = t_1; elseif (z <= -1.95e-156) tmp = Float64(Float64(y * Float64(x - t)) / z); elseif (z <= 2.15e-19) tmp = Float64(y * Float64(Float64(t - x) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -2.75e+78) tmp = t_1; elseif (z <= -1.95e-156) tmp = (y * (x - t)) / z; elseif (z <= 2.15e-19) tmp = y * ((t - x) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.75e+78], t$95$1, If[LessEqual[z, -1.95e-156], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.15e-19], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -2.75 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-156}:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-19}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.7499999999999999e78 or 2.15e-19 < z Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -2.7499999999999999e78 < z < -1.9500000000000001e-156Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
sqr-neg-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
times-fracN/A
frac-2neg-revN/A
Applied rewrites42.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.4
Applied rewrites23.4%
if -1.9500000000000001e-156 < z < 2.15e-19Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6425.2
Applied rewrites25.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.4e-79)
(+ x (- t x))
(if (<= t 2.7e-184)
(/ (* x y) (- z a))
(if (<= t 1.15e+83) (/ (* x (- y a)) z) (* y (/ t (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.4e-79) {
tmp = x + (t - x);
} else if (t <= 2.7e-184) {
tmp = (x * y) / (z - a);
} else if (t <= 1.15e+83) {
tmp = (x * (y - a)) / z;
} else {
tmp = y * (t / (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 (t <= (-8.4d-79)) then
tmp = x + (t - x)
else if (t <= 2.7d-184) then
tmp = (x * y) / (z - a)
else if (t <= 1.15d+83) then
tmp = (x * (y - a)) / z
else
tmp = y * (t / (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 (t <= -8.4e-79) {
tmp = x + (t - x);
} else if (t <= 2.7e-184) {
tmp = (x * y) / (z - a);
} else if (t <= 1.15e+83) {
tmp = (x * (y - a)) / z;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.4e-79: tmp = x + (t - x) elif t <= 2.7e-184: tmp = (x * y) / (z - a) elif t <= 1.15e+83: tmp = (x * (y - a)) / z else: tmp = y * (t / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.4e-79) tmp = Float64(x + Float64(t - x)); elseif (t <= 2.7e-184) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (t <= 1.15e+83) tmp = Float64(Float64(x * Float64(y - a)) / z); else tmp = Float64(y * Float64(t / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.4e-79) tmp = x + (t - x); elseif (t <= 2.7e-184) tmp = (x * y) / (z - a); elseif (t <= 1.15e+83) tmp = (x * (y - a)) / z; else tmp = y * (t / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.4e-79], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-184], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+83], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{-79}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-184}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+83}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if t < -8.3999999999999998e-79Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -8.3999999999999998e-79 < t < 2.7000000000000001e-184Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
sqr-neg-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
times-fracN/A
frac-2neg-revN/A
Applied rewrites42.9%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if 2.7000000000000001e-184 < t < 1.14999999999999997e83Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6419.5
Applied rewrites19.5%
if 1.14999999999999997e83 < t Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6422.9
Applied rewrites22.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.4e-79)
(+ x (- t x))
(if (<= t 2.7e-184)
(/ (* x y) (- z a))
(if (<= t 1.16e+83) (/ (* x (- y a)) z) (/ (* t y) (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.4e-79) {
tmp = x + (t - x);
} else if (t <= 2.7e-184) {
tmp = (x * y) / (z - a);
} else if (t <= 1.16e+83) {
tmp = (x * (y - a)) / z;
} else {
tmp = (t * y) / (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 (t <= (-8.4d-79)) then
tmp = x + (t - x)
else if (t <= 2.7d-184) then
tmp = (x * y) / (z - a)
else if (t <= 1.16d+83) then
tmp = (x * (y - a)) / z
else
tmp = (t * y) / (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 (t <= -8.4e-79) {
tmp = x + (t - x);
} else if (t <= 2.7e-184) {
tmp = (x * y) / (z - a);
} else if (t <= 1.16e+83) {
tmp = (x * (y - a)) / z;
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.4e-79: tmp = x + (t - x) elif t <= 2.7e-184: tmp = (x * y) / (z - a) elif t <= 1.16e+83: tmp = (x * (y - a)) / z else: tmp = (t * y) / (a - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.4e-79) tmp = Float64(x + Float64(t - x)); elseif (t <= 2.7e-184) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (t <= 1.16e+83) tmp = Float64(Float64(x * Float64(y - a)) / z); else tmp = Float64(Float64(t * y) / Float64(a - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.4e-79) tmp = x + (t - x); elseif (t <= 2.7e-184) tmp = (x * y) / (z - a); elseif (t <= 1.16e+83) tmp = (x * (y - a)) / z; else tmp = (t * y) / (a - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.4e-79], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-184], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e+83], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{-79}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-184}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{+83}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\end{array}
\end{array}
if t < -8.3999999999999998e-79Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -8.3999999999999998e-79 < t < 2.7000000000000001e-184Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
sqr-neg-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
times-fracN/A
frac-2neg-revN/A
Applied rewrites42.9%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if 2.7000000000000001e-184 < t < 1.1600000000000001e83Initial program 69.0%
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--.f6445.7
Applied rewrites45.7%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6419.5
Applied rewrites19.5%
if 1.1600000000000001e83 < t Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.2
Applied rewrites21.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- t x)))) (if (<= z -1.5e+77) t_1 (if (<= z 9e+36) (/ (* x y) (- z a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -1.5e+77) {
tmp = t_1;
} else if (z <= 9e+36) {
tmp = (x * y) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t - x)
if (z <= (-1.5d+77)) then
tmp = t_1
else if (z <= 9d+36) then
tmp = (x * y) / (z - a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -1.5e+77) {
tmp = t_1;
} else if (z <= 9e+36) {
tmp = (x * y) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -1.5e+77: tmp = t_1 elif z <= 9e+36: tmp = (x * y) / (z - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -1.5e+77) tmp = t_1; elseif (z <= 9e+36) tmp = Float64(Float64(x * y) / Float64(z - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -1.5e+77) tmp = t_1; elseif (z <= 9e+36) tmp = (x * y) / (z - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+77], t$95$1, If[LessEqual[z, 9e+36], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+36}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.4999999999999999e77 or 8.99999999999999994e36 < z Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -1.4999999999999999e77 < z < 8.99999999999999994e36Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
sqr-neg-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
times-fracN/A
frac-2neg-revN/A
Applied rewrites42.9%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- t x)))) (if (<= z -8.5e+37) t_1 (if (<= z 1.9e-39) (/ (* t y) (- a z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -8.5e+37) {
tmp = t_1;
} else if (z <= 1.9e-39) {
tmp = (t * y) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t - x)
if (z <= (-8.5d+37)) then
tmp = t_1
else if (z <= 1.9d-39) then
tmp = (t * y) / (a - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -8.5e+37) {
tmp = t_1;
} else if (z <= 1.9e-39) {
tmp = (t * y) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -8.5e+37: tmp = t_1 elif z <= 1.9e-39: tmp = (t * y) / (a - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -8.5e+37) tmp = t_1; elseif (z <= 1.9e-39) tmp = Float64(Float64(t * y) / Float64(a - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -8.5e+37) tmp = t_1; elseif (z <= 1.9e-39) tmp = (t * y) / (a - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+37], t$95$1, If[LessEqual[z, 1.9e-39], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-39}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.4999999999999999e37 or 1.9000000000000001e-39 < z Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -8.4999999999999999e37 < z < 1.9000000000000001e-39Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.2
Applied rewrites21.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- t x)))) (if (<= z -3.9e-29) t_1 (if (<= z 1.26e-39) (/ (* t y) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -3.9e-29) {
tmp = t_1;
} else if (z <= 1.26e-39) {
tmp = (t * y) / a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t - x)
if (z <= (-3.9d-29)) then
tmp = t_1
else if (z <= 1.26d-39) then
tmp = (t * y) / a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -3.9e-29) {
tmp = t_1;
} else if (z <= 1.26e-39) {
tmp = (t * y) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -3.9e-29: tmp = t_1 elif z <= 1.26e-39: tmp = (t * y) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -3.9e-29) tmp = t_1; elseif (z <= 1.26e-39) tmp = Float64(Float64(t * y) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -3.9e-29) tmp = t_1; elseif (z <= 1.26e-39) tmp = (t * y) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e-29], t$95$1, If[LessEqual[z, 1.26e-39], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{-39}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8999999999999998e-29 or 1.26e-39 < z Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
if -3.8999999999999998e-29 < z < 1.26e-39Initial program 69.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in z around 0
Applied rewrites30.4%
Taylor expanded in z around 0
Applied rewrites24.7%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
associate-*l/N/A
lift-*.f64N/A
lower-/.f6423.6
Applied rewrites23.6%
Taylor expanded in x around 0
Applied rewrites16.5%
(FPCore (x y z t a) :precision binary64 (+ x (- t x)))
double code(double x, double y, double z, double t, double a) {
return x + (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 = x + (t - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
def code(x, y, z, t, a): return x + (t - x)
function code(x, y, z, t, a) return Float64(x + Float64(t - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (t - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right)
\end{array}
Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
(FPCore (x y z t a) :precision binary64 (+ (- x) x))
double code(double x, double y, double z, double t, double a) {
return -x + 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 = -x + x
end function
public static double code(double x, double y, double z, double t, double a) {
return -x + x;
}
def code(x, y, z, t, a): return -x + x
function code(x, y, z, t, a) return Float64(Float64(-x) + x) end
function tmp = code(x, y, z, t, a) tmp = -x + x; end
code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) + x
\end{array}
Initial program 69.0%
Taylor expanded in z around inf
lower--.f6419.4
Applied rewrites19.4%
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%
herbie shell --seed 2025154
(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))))