
(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 14 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
(let* ((t_1 (fma (- y z) (/ (- x t) (- z a)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-246)
t_2
(if (<= t_2 0.0)
(+ (* -1.0 (* x (- (+ (/ a z) (/ (* t (- y a)) (* x z))) (/ y z)))) t)
(if (<= t_2 5e+301) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((x - t) / (z - a)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-246) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (-1.0 * (x * (((a / z) + ((t * (y - a)) / (x * z))) - (y / z)))) + t;
} else if (t_2 <= 5e+301) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(x - t) / Float64(z - a)), x) 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 <= -1e-246) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(x * Float64(Float64(Float64(a / z) + Float64(Float64(t * Float64(y - a)) / Float64(x * z))) - Float64(y / z)))) + t); elseif (t_2 <= 5e+301) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $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, -1e-246], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 * N[(x * N[(N[(N[(a / z), $MachinePrecision] + N[(N[(t * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$2, 5e+301], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{x - t}{z - a}, x\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 -1 \cdot 10^{-246}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(\left(\frac{a}{z} + \frac{t \cdot \left(y - a\right)}{x \cdot z}\right) - \frac{y}{z}\right)\right) + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or 5.0000000000000004e301 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -9.99999999999999956e-247 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5.0000000000000004e301Initial program 68.4%
if -9.99999999999999956e-247 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 68.4%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.4
Applied rewrites46.4%
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
lift--.f64N/A
lower-*.f64N/A
lower-/.f6444.5
Applied rewrites44.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- x t) (- z a)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-246)
t_2
(if (<= t_2 0.0)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_2 5e+301) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((x - t) / (z - a)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-246) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_2 <= 5e+301) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(x - t) / Float64(z - a)), x) 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 <= -1e-246) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_2 <= 5e+301) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $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, -1e-246], t$95$2, If[LessEqual[t$95$2, 0.0], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$2, 5e+301], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{x - t}{z - a}, x\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 -1 \cdot 10^{-246}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or 5.0000000000000004e301 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -9.99999999999999956e-247 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5.0000000000000004e301Initial program 68.4%
if -9.99999999999999956e-247 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 68.4%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.4
Applied rewrites46.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- x t) (- z a)) x)))
(if (<= a -1.9e-221)
t_1
(if (<= a 1.16e-153) (+ (- (/ (* (- t x) (- y a)) z)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((x - t) / (z - a)), x);
double tmp;
if (a <= -1.9e-221) {
tmp = t_1;
} else if (a <= 1.16e-153) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(x - t) / Float64(z - a)), x) tmp = 0.0 if (a <= -1.9e-221) tmp = t_1; elseif (a <= 1.16e-153) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * 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[(y - z), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.9e-221], t$95$1, If[LessEqual[a, 1.16e-153], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{x - t}{z - a}, x\right)\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{-221}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.16 \cdot 10^{-153}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.9e-221 or 1.16e-153 < a Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
if -1.9e-221 < a < 1.16e-153Initial program 68.4%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.4
Applied rewrites46.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -1.8e+168)
t_1
(if (<= z -1.05e-40)
(+ x (/ (* (- y z) t) (- a z)))
(if (<= z 7.4e+86) (fma (- t x) (/ (- y z) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -1.8e+168) {
tmp = t_1;
} else if (z <= -1.05e-40) {
tmp = x + (((y - z) * t) / (a - z));
} else if (z <= 7.4e+86) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -1.8e+168) tmp = t_1; elseif (z <= -1.05e-40) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); elseif (z <= 7.4e+86) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+168], t$95$1, If[LessEqual[z, -1.05e-40], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e+86], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-40}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.8e168 or 7.39999999999999983e86 < z Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift--.f64N/A
frac-2negN/A
metadata-evalN/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6480.5
Applied rewrites80.5%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6452.1
Applied rewrites52.1%
if -1.8e168 < z < -1.05000000000000009e-40Initial program 68.4%
Taylor expanded in x around 0
Applied rewrites56.1%
if -1.05000000000000009e-40 < z < 7.39999999999999983e86Initial program 68.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.7
Applied rewrites53.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -3.3e-11)
t_1
(if (<= z 7.4e+86) (fma (- t x) (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -3.3e-11) {
tmp = t_1;
} else if (z <= 7.4e+86) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -3.3e-11) tmp = t_1; elseif (z <= 7.4e+86) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e-11], t$95$1, If[LessEqual[z, 7.4e+86], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.3000000000000002e-11 or 7.39999999999999983e86 < z Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift--.f64N/A
frac-2negN/A
metadata-evalN/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6480.5
Applied rewrites80.5%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6452.1
Applied rewrites52.1%
if -3.3000000000000002e-11 < z < 7.39999999999999983e86Initial program 68.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.7
Applied rewrites53.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -1.62e-11)
t_1
(if (<= z 9600000.0) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -1.62e-11) {
tmp = t_1;
} else if (z <= 9600000.0) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -1.62e-11) tmp = t_1; elseif (z <= 9600000.0) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.62e-11], t$95$1, If[LessEqual[z, 9600000.0], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -1.62 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9600000:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.62e-11 or 9.6e6 < z Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift--.f64N/A
frac-2negN/A
metadata-evalN/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6480.5
Applied rewrites80.5%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6452.1
Applied rewrites52.1%
if -1.62e-11 < z < 9.6e6Initial program 68.4%
Taylor expanded in z around inf
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in z around 0
+-commutativeN/A
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (/ (* y (- t x)) z)))) (if (<= z -7e-40) t_1 (if (<= z 1.55e-60) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y * (t - x)) / z);
double tmp;
if (z <= -7e-40) {
tmp = t_1;
} else if (z <= 1.55e-60) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y * Float64(t - x)) / z)) tmp = 0.0 if (z <= -7e-40) tmp = t_1; elseif (z <= 1.55e-60) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e-40], t$95$1, If[LessEqual[z, 1.55e-60], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y \cdot \left(t - x\right)}{z}\\
\mathbf{if}\;z \leq -7 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-60}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.0000000000000003e-40 or 1.54999999999999994e-60 < z Initial program 68.4%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.4
Applied rewrites46.4%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6444.4
Applied rewrites44.4%
if -7.0000000000000003e-40 < z < 1.54999999999999994e-60Initial program 68.4%
Taylor expanded in z around inf
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in z around 0
+-commutativeN/A
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e+165) t (if (<= z 2.8e+111) (fma (- t x) (/ y a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+165) {
tmp = t;
} else if (z <= 2.8e+111) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+165) tmp = t; elseif (z <= 2.8e+111) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+165], t, If[LessEqual[z, 2.8e+111], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+165}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.49999999999999995e165 or 2.7999999999999999e111 < z Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
Applied rewrites25.2%
if -1.49999999999999995e165 < z < 2.7999999999999999e111Initial program 68.4%
Taylor expanded in z around inf
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in z around 0
+-commutativeN/A
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e+165) t (if (<= z 2.8e+111) (fma y (/ (- t x) a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+165) {
tmp = t;
} else if (z <= 2.8e+111) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+165) tmp = t; elseif (z <= 2.8e+111) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+165], t, If[LessEqual[z, 2.8e+111], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+165}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.49999999999999995e165 or 2.7999999999999999e111 < z Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
Applied rewrites25.2%
if -1.49999999999999995e165 < z < 2.7999999999999999e111Initial program 68.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.3
Applied rewrites48.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e+217)
t
(if (<= z -5.1e-49)
(- x (* -1.0 t))
(if (<= z 2.8e+111) (fma y (/ t a) x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+217) {
tmp = t;
} else if (z <= -5.1e-49) {
tmp = x - (-1.0 * t);
} else if (z <= 2.8e+111) {
tmp = fma(y, (t / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+217) tmp = t; elseif (z <= -5.1e-49) tmp = Float64(x - Float64(-1.0 * t)); elseif (z <= 2.8e+111) tmp = fma(y, Float64(t / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+217], t, If[LessEqual[z, -5.1e-49], N[(x - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+111], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+217}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-49}:\\
\;\;\;\;x - -1 \cdot t\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.6e217 or 2.7999999999999999e111 < z Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
Applied rewrites25.2%
if -1.6e217 < z < -5.10000000000000026e-49Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
lower-*.f6434.0
Applied rewrites34.0%
if -5.10000000000000026e-49 < z < 2.7999999999999999e111Initial program 68.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.3
Applied rewrites48.3%
Taylor expanded in x around 0
lower-/.f6440.2
Applied rewrites40.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (/ y a)))) (if (<= y -1.55e+122) t_1 (if (<= y 1.3e+111) (- x (* -1.0 t)) 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.55e+122) {
tmp = t_1;
} else if (y <= 1.3e+111) {
tmp = x - (-1.0 * 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 * (y / a)
if (y <= (-1.55d+122)) then
tmp = t_1
else if (y <= 1.3d+111) then
tmp = x - ((-1.0d0) * 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 * (y / a);
double tmp;
if (y <= -1.55e+122) {
tmp = t_1;
} else if (y <= 1.3e+111) {
tmp = x - (-1.0 * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if y <= -1.55e+122: tmp = t_1 elif y <= 1.3e+111: tmp = x - (-1.0 * t) 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.55e+122) tmp = t_1; elseif (y <= 1.3e+111) tmp = Float64(x - Float64(-1.0 * t)); 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.55e+122) tmp = t_1; elseif (y <= 1.3e+111) tmp = x - (-1.0 * t); 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, -1.55e+122], t$95$1, If[LessEqual[y, 1.3e+111], N[(x - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+111}:\\
\;\;\;\;x - -1 \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.54999999999999999e122 or 1.2999999999999999e111 < y Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift--.f64N/A
frac-2negN/A
metadata-evalN/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6480.5
Applied rewrites80.5%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6452.1
Applied rewrites52.1%
Taylor expanded in z around 0
lower-/.f6419.4
Applied rewrites19.4%
if -1.54999999999999999e122 < y < 1.2999999999999999e111Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
lower-*.f6434.0
Applied rewrites34.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.65e+159) (/ (* t y) a) (- x (* -1.0 t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.65e+159) {
tmp = (t * y) / a;
} else {
tmp = x - (-1.0 * t);
}
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.65d+159)) then
tmp = (t * y) / a
else
tmp = x - ((-1.0d0) * t)
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.65e+159) {
tmp = (t * y) / a;
} else {
tmp = x - (-1.0 * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.65e+159: tmp = (t * y) / a else: tmp = x - (-1.0 * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.65e+159) tmp = Float64(Float64(t * y) / a); else tmp = Float64(x - Float64(-1.0 * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.65e+159) tmp = (t * y) / a; else tmp = x - (-1.0 * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.65e+159], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], N[(x - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{+159}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - -1 \cdot t\\
\end{array}
\end{array}
if y < -2.6499999999999999e159Initial program 68.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.3
Applied rewrites48.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6416.7
Applied rewrites16.7%
if -2.6499999999999999e159 < y Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
lower-*.f6434.0
Applied rewrites34.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.3e+206) t (if (<= z 1.35e+186) (- x (* -1.0 t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+206) {
tmp = t;
} else if (z <= 1.35e+186) {
tmp = x - (-1.0 * t);
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.3d+206)) then
tmp = t
else if (z <= 1.35d+186) then
tmp = x - ((-1.0d0) * t)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+206) {
tmp = t;
} else if (z <= 1.35e+186) {
tmp = x - (-1.0 * t);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+206: tmp = t elif z <= 1.35e+186: tmp = x - (-1.0 * t) else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+206) tmp = t; elseif (z <= 1.35e+186) tmp = Float64(x - Float64(-1.0 * t)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+206) tmp = t; elseif (z <= 1.35e+186) tmp = x - (-1.0 * t); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+206], t, If[LessEqual[z, 1.35e+186], N[(x - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+206}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+186}:\\
\;\;\;\;x - -1 \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.29999999999999994e206 or 1.3499999999999999e186 < z Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
Applied rewrites25.2%
if -1.29999999999999994e206 < z < 1.3499999999999999e186Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
lower-*.f6434.0
Applied rewrites34.0%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negate-revN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in z around inf
+-commutativeN/A
frac-2negN/A
mul-1-negN/A
sub-negate-revN/A
associate-/l*N/A
mul-1-negN/A
sub-negate-revN/A
add-flipN/A
mul-1-negN/A
sub-negate-revN/A
sub-negate-revN/A
lower--.f64N/A
lift--.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
Applied rewrites25.2%
herbie shell --seed 2025134
(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))))