
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))) (t_2 (/ (- z t) a)))
(if (<= t_1 (- INFINITY))
(* t_2 y)
(if (<= t_1 5e+189) (+ x (/ t_1 a)) (fma t_2 y x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = (z - t) / a;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2 * y;
} else if (t_1 <= 5e+189) {
tmp = x + (t_1 / a);
} else {
tmp = fma(t_2, y, x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) t_2 = Float64(Float64(z - t) / a) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t_2 * y); elseif (t_1 <= 5e+189) tmp = Float64(x + Float64(t_1 / a)); else tmp = fma(t_2, y, x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t$95$2 * y), $MachinePrecision], If[LessEqual[t$95$1, 5e+189], N[(x + N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
t_2 := \frac{z - t}{a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2 \cdot y\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+189}:\\
\;\;\;\;x + \frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, y, x\right)\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -inf.0Initial program 68.8%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6461.7
Applied rewrites61.7%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
distribute-rgt-out--N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6493.2
Applied rewrites93.2%
if -inf.0 < (*.f64 y (-.f64 z t)) < 5.0000000000000004e189Initial program 99.3%
if 5.0000000000000004e189 < (*.f64 y (-.f64 z t)) Initial program 84.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6498.9
Applied rewrites98.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))))
(if (<= t_1 (- INFINITY))
(* (/ (- z t) a) y)
(if (<= t_1 2e+226)
(+ x (/ (fma z y (* (- y) t)) a))
(fma (- z t) (/ y a) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((z - t) / a) * y;
} else if (t_1 <= 2e+226) {
tmp = x + (fma(z, y, (-y * t)) / a);
} else {
tmp = fma((z - t), (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(z - t) / a) * y); elseif (t_1 <= 2e+226) tmp = Float64(x + Float64(fma(z, y, Float64(Float64(-y) * t)) / a)); else tmp = fma(Float64(z - t), Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 2e+226], N[(x + N[(N[(z * y + N[((-y) * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z - t}{a} \cdot y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+226}:\\
\;\;\;\;x + \frac{\mathsf{fma}\left(z, y, \left(-y\right) \cdot t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -inf.0Initial program 68.8%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6461.7
Applied rewrites61.7%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
distribute-rgt-out--N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6493.2
Applied rewrites93.2%
if -inf.0 < (*.f64 y (-.f64 z t)) < 1.99999999999999992e226Initial program 99.4%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.4
Applied rewrites99.4%
if 1.99999999999999992e226 < (*.f64 y (-.f64 z t)) Initial program 81.1%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6476.1
Applied rewrites76.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
distribute-rgt-out--N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a) :precision binary64 (if (<= a 2e-68) (fma (- z t) (/ y a) x) (fma (/ (- z t) a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2e-68) {
tmp = fma((z - t), (y / a), x);
} else {
tmp = fma(((z - t) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2e-68) tmp = fma(Float64(z - t), Float64(y / a), x); else tmp = fma(Float64(Float64(z - t) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2e-68], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2 \cdot 10^{-68}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\end{array}
\end{array}
if a < 2.00000000000000013e-68Initial program 95.1%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6493.5
Applied rewrites93.5%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
distribute-rgt-out--N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6496.9
Applied rewrites96.9%
if 2.00000000000000013e-68 < a Initial program 89.7%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6498.7
Applied rewrites98.7%
(FPCore (x y z t a) :precision binary64 (fma (- z t) (/ y a) x))
double code(double x, double y, double z, double t, double a) {
return fma((z - t), (y / a), x);
}
function code(x, y, z, t, a) return fma(Float64(z - t), Float64(y / a), x) end
code[x_, y_, z_, t_, a_] := N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)
\end{array}
Initial program 93.5%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6492.0
Applied rewrites92.0%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
distribute-rgt-out--N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6497.3
Applied rewrites97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z t) a) y))
(t_2 (/ (* (- z t) y) a))
(t_3 (/ (* y (- z t)) a)))
(if (<= t_3 (- INFINITY))
t_1
(if (<= t_3 -5e+69)
t_2
(if (<= t_3 2e+34) (fma (/ z a) y x) (if (<= t_3 5e+306) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / a) * y;
double t_2 = ((z - t) * y) / a;
double t_3 = (y * (z - t)) / a;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_3 <= -5e+69) {
tmp = t_2;
} else if (t_3 <= 2e+34) {
tmp = fma((z / a), y, x);
} else if (t_3 <= 5e+306) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / a) * y) t_2 = Float64(Float64(Float64(z - t) * y) / a) t_3 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_1; elseif (t_3 <= -5e+69) tmp = t_2; elseif (t_3 <= 2e+34) tmp = fma(Float64(z / a), y, x); elseif (t_3 <= 5e+306) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -5e+69], t$95$2, If[LessEqual[t$95$3, 2e+34], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$3, 5e+306], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a} \cdot y\\
t_2 := \frac{\left(z - t\right) \cdot y}{a}\\
t_3 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0 or 4.99999999999999993e306 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 80.7%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6475.9
Applied rewrites75.9%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
distribute-rgt-out--N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6496.3
Applied rewrites96.3%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < -5.00000000000000036e69 or 1.99999999999999989e34 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.99999999999999993e306Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6477.4
Applied rewrites77.4%
if -5.00000000000000036e69 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999989e34Initial program 99.0%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6498.6
Applied rewrites98.6%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6486.8
Applied rewrites86.8%
Taylor expanded in z around inf
lower-/.f6485.3
Applied rewrites85.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (/ (* (- z t) y) a))) (if (<= t_1 -5e+69) t_2 (if (<= t_1 2e+34) (fma (/ z a) y x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = ((z - t) * y) / a;
double tmp;
if (t_1 <= -5e+69) {
tmp = t_2;
} else if (t_1 <= 2e+34) {
tmp = fma((z / a), y, x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(Float64(Float64(z - t) * y) / a) tmp = 0.0 if (t_1 <= -5e+69) tmp = t_2; elseif (t_1 <= 2e+34) tmp = fma(Float64(z / a), y, x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+69], t$95$2, If[LessEqual[t$95$1, 2e+34], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.00000000000000036e69 or 1.99999999999999989e34 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 89.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6479.2
Applied rewrites79.2%
if -5.00000000000000036e69 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999989e34Initial program 99.0%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6498.6
Applied rewrites98.6%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6486.8
Applied rewrites86.8%
Taylor expanded in z around inf
lower-/.f6485.3
Applied rewrites85.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (/ (* t y) a)))) (if (<= t -7.6e+123) t_1 (if (<= t 1e+60) (fma (/ y a) z x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((t * y) / a);
double tmp;
if (t <= -7.6e+123) {
tmp = t_1;
} else if (t <= 1e+60) {
tmp = fma((y / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(t * y) / a)) tmp = 0.0 if (t <= -7.6e+123) tmp = t_1; elseif (t <= 1e+60) tmp = fma(Float64(y / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.6e+123], t$95$1, If[LessEqual[t, 1e+60], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{t \cdot y}{a}\\
\mathbf{if}\;t \leq -7.6 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.59999999999999989e123 or 9.9999999999999995e59 < t Initial program 90.9%
Taylor expanded in z around 0
mul-1-negN/A
negate-subN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6482.5
Applied rewrites82.5%
if -7.59999999999999989e123 < t < 9.9999999999999995e59Initial program 94.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6484.2
Applied rewrites84.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.4e+156) (* (/ y a) (- t)) (if (<= t 6e+209) (fma (/ y a) z x) (/ (* (- t) y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.4e+156) {
tmp = (y / a) * -t;
} else if (t <= 6e+209) {
tmp = fma((y / a), z, x);
} else {
tmp = (-t * y) / a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.4e+156) tmp = Float64(Float64(y / a) * Float64(-t)); elseif (t <= 6e+209) tmp = fma(Float64(y / a), z, x); else tmp = Float64(Float64(Float64(-t) * y) / a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.4e+156], N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[t, 6e+209], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], N[(N[((-t) * y), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+156}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+209}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-t\right) \cdot y}{a}\\
\end{array}
\end{array}
if t < -3.4000000000000001e156Initial program 90.1%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6465.3
Applied rewrites65.3%
if -3.4000000000000001e156 < t < 5.99999999999999971e209Initial program 94.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
if 5.99999999999999971e209 < t Initial program 88.8%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6487.1
Applied rewrites87.1%
Taylor expanded in t around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6466.5
Applied rewrites66.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a))) (if (<= t_1 -5e-33) (* z (/ y a)) (if (<= t_1 2e+34) x (* (/ y a) (- t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -5e-33) {
tmp = z * (y / a);
} else if (t_1 <= 2e+34) {
tmp = x;
} else {
tmp = (y / a) * -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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / a
if (t_1 <= (-5d-33)) then
tmp = z * (y / a)
else if (t_1 <= 2d+34) then
tmp = x
else
tmp = (y / a) * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -5e-33) {
tmp = z * (y / a);
} else if (t_1 <= 2e+34) {
tmp = x;
} else {
tmp = (y / a) * -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -5e-33: tmp = z * (y / a) elif t_1 <= 2e+34: tmp = x else: tmp = (y / a) * -t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -5e-33) tmp = Float64(z * Float64(y / a)); elseif (t_1 <= 2e+34) tmp = x; else tmp = Float64(Float64(y / a) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -5e-33) tmp = z * (y / a); elseif (t_1 <= 2e+34) tmp = x; else tmp = (y / a) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-33], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+34], x, N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-33}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.00000000000000028e-33Initial program 90.3%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6489.2
Applied rewrites89.2%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
div-addN/A
lift-fma.f64N/A
lift-/.f6472.8
Applied rewrites73.9%
Taylor expanded in z around inf
Applied rewrites40.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6446.3
Applied rewrites46.3%
if -5.00000000000000028e-33 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999989e34Initial program 98.9%
Taylor expanded in x around inf
Applied rewrites77.8%
if 1.99999999999999989e34 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 90.2%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6450.5
Applied rewrites50.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* z (/ y a)))) (if (<= t_1 -5e-33) t_2 (if (<= t_1 5e-35) x t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = z * (y / a);
double tmp;
if (t_1 <= -5e-33) {
tmp = t_2;
} else if (t_1 <= 5e-35) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * (z - t)) / a
t_2 = z * (y / a)
if (t_1 <= (-5d-33)) then
tmp = t_2
else if (t_1 <= 5d-35) then
tmp = x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = z * (y / a);
double tmp;
if (t_1 <= -5e-33) {
tmp = t_2;
} else if (t_1 <= 5e-35) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = z * (y / a) tmp = 0 if t_1 <= -5e-33: tmp = t_2 elif t_1 <= 5e-35: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(z * Float64(y / a)) tmp = 0.0 if (t_1 <= -5e-33) tmp = t_2; elseif (t_1 <= 5e-35) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = z * (y / a); tmp = 0.0; if (t_1 <= -5e-33) tmp = t_2; elseif (t_1 <= 5e-35) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-33], t$95$2, If[LessEqual[t$95$1, 5e-35], x, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := z \cdot \frac{y}{a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.00000000000000028e-33 or 4.99999999999999964e-35 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 90.8%
lift-*.f64N/A
lift--.f64N/A
negate-subN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6489.7
Applied rewrites89.7%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
div-addN/A
lift-fma.f64N/A
lift-/.f6474.0
Applied rewrites75.2%
Taylor expanded in z around inf
Applied rewrites41.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6446.1
Applied rewrites46.1%
if -5.00000000000000028e-33 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.99999999999999964e-35Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites81.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* y (/ z a)))) (if (<= t_1 -4e+53) t_2 (if (<= t_1 5e-35) x t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = y * (z / a);
double tmp;
if (t_1 <= -4e+53) {
tmp = t_2;
} else if (t_1 <= 5e-35) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * (z - t)) / a
t_2 = y * (z / a)
if (t_1 <= (-4d+53)) then
tmp = t_2
else if (t_1 <= 5d-35) then
tmp = x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = y * (z / a);
double tmp;
if (t_1 <= -4e+53) {
tmp = t_2;
} else if (t_1 <= 5e-35) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = y * (z / a) tmp = 0 if t_1 <= -4e+53: tmp = t_2 elif t_1 <= 5e-35: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(y * Float64(z / a)) tmp = 0.0 if (t_1 <= -4e+53) tmp = t_2; elseif (t_1 <= 5e-35) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = y * (z / a); tmp = 0.0; if (t_1 <= -4e+53) tmp = t_2; elseif (t_1 <= 5e-35) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+53], t$95$2, If[LessEqual[t$95$1, 5e-35], x, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := y \cdot \frac{z}{a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+53}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -4e53 or 4.99999999999999964e-35 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 90.1%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6443.0
Applied rewrites43.0%
if -4e53 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.99999999999999964e-35Initial program 98.9%
Taylor expanded in x around inf
Applied rewrites77.6%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return 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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.5%
Taylor expanded in x around inf
Applied rewrites39.4%
herbie shell --seed 2025110
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
(+ x (/ (* y (- z t)) a)))