
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - 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 = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - 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 = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t z) (- t a)) (- y x) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -1e-218)
t_1
(if (<= t_2 1e-301)
(+ y (* -1.0 (/ (- (* z (- y x)) (* a (- y x))) t)))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), (y - x), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -1e-218) {
tmp = t_1;
} else if (t_2 <= 1e-301) {
tmp = y + (-1.0 * (((z * (y - x)) - (a * (y - x))) / t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -1e-218) tmp = t_1; elseif (t_2 <= 1e-301) tmp = Float64(y + Float64(-1.0 * Float64(Float64(Float64(z * Float64(y - x)) - Float64(a * Float64(y - x))) / t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-218], t$95$1, If[LessEqual[t$95$2, 1e-301], N[(y + N[(-1.0 * N[(N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-301}:\\
\;\;\;\;y + -1 \cdot \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1e-218 or 1.00000000000000007e-301 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
if -1e-218 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.00000000000000007e-301Initial program 67.5%
Taylor expanded in t around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.3
Applied rewrites46.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t z) (- t a)) (- y x) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -1e-218)
t_1
(if (<= t_2 0.0)
(/ (fma -1.0 (* a x) (* -1.0 (* z (- y x)))) (- t a))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), (y - x), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -1e-218) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(-1.0, (a * x), (-1.0 * (z * (y - x)))) / (t - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -1e-218) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(fma(-1.0, Float64(a * x), Float64(-1.0 * Float64(z * Float64(y - x)))) / Float64(t - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-218], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 * N[(a * x), $MachinePrecision] + N[(-1.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, a \cdot x, -1 \cdot \left(z \cdot \left(y - x\right)\right)\right)}{t - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1e-218 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
if -1e-218 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 67.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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--.f6479.5
Applied rewrites79.5%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6479.2
Applied rewrites79.2%
Applied rewrites62.6%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f6455.7
Applied rewrites55.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -3e+158) (* (/ (- z t) (- a t)) y) (fma (/ (- t z) (- t a)) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e+158) {
tmp = ((z - t) / (a - t)) * y;
} else {
tmp = fma(((t - z) / (t - a)), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e+158) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); else tmp = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e+158], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+158}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -3e158Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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-*.f6451.2
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.2
Applied rewrites51.2%
if -3e158 < t Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.1e+152) (* (/ (- z t) (- a t)) y) (fma (- z t) (/ (- x y) (- t a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.1e+152) {
tmp = ((z - t) / (a - t)) * y;
} else {
tmp = fma((z - t), ((x - y) / (t - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.1e+152) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); else tmp = fma(Float64(z - t), Float64(Float64(x - y) / Float64(t - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.1e+152], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+152}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{x - y}{t - a}, x\right)\\
\end{array}
\end{array}
if t < -4.0999999999999998e152Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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-*.f6451.2
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.2
Applied rewrites51.2%
if -4.0999999999999998e152 < t Initial program 67.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/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--.f6479.5
Applied rewrites79.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -120000000000.0)
(* (/ (- z t) (- a t)) y)
(if (<= t 3.5e-136)
(+ x (/ (* z (- y x)) (- a t)))
(if (<= t 2.9e+114)
(+ x (/ (* y (- z t)) (- a t)))
(/ y (/ (- a t) (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -120000000000.0) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 3.5e-136) {
tmp = x + ((z * (y - x)) / (a - t));
} else if (t <= 2.9e+114) {
tmp = x + ((y * (z - t)) / (a - t));
} else {
tmp = y / ((a - t) / (z - 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 (t <= (-120000000000.0d0)) then
tmp = ((z - t) / (a - t)) * y
else if (t <= 3.5d-136) then
tmp = x + ((z * (y - x)) / (a - t))
else if (t <= 2.9d+114) then
tmp = x + ((y * (z - t)) / (a - t))
else
tmp = y / ((a - t) / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -120000000000.0) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 3.5e-136) {
tmp = x + ((z * (y - x)) / (a - t));
} else if (t <= 2.9e+114) {
tmp = x + ((y * (z - t)) / (a - t));
} else {
tmp = y / ((a - t) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -120000000000.0: tmp = ((z - t) / (a - t)) * y elif t <= 3.5e-136: tmp = x + ((z * (y - x)) / (a - t)) elif t <= 2.9e+114: tmp = x + ((y * (z - t)) / (a - t)) else: tmp = y / ((a - t) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -120000000000.0) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); elseif (t <= 3.5e-136) tmp = Float64(x + Float64(Float64(z * Float64(y - x)) / Float64(a - t))); elseif (t <= 2.9e+114) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))); else tmp = Float64(y / Float64(Float64(a - t) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -120000000000.0) tmp = ((z - t) / (a - t)) * y; elseif (t <= 3.5e-136) tmp = x + ((z * (y - x)) / (a - t)); elseif (t <= 2.9e+114) tmp = x + ((y * (z - t)) / (a - t)); else tmp = y / ((a - t) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -120000000000.0], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 3.5e-136], N[(x + N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+114], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -120000000000:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-136}:\\
\;\;\;\;x + \frac{z \cdot \left(y - x\right)}{a - t}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+114}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a - t}{z - t}}\\
\end{array}
\end{array}
if t < -1.2e11Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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-*.f6451.2
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.2
Applied rewrites51.2%
if -1.2e11 < t < 3.50000000000000029e-136Initial program 67.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6454.2
Applied rewrites54.2%
if 3.50000000000000029e-136 < t < 2.9e114Initial program 67.5%
Taylor expanded in x around 0
Applied rewrites54.4%
if 2.9e114 < t Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -120000000000.0)
(* (/ (- z t) (- a t)) y)
(if (<= t -2.9e-177)
(+ x (/ (* z (- y x)) (- a t)))
(if (<= t 7.5e+86) (fma (/ z a) (- y x) x) (/ y (/ (- a t) (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -120000000000.0) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= -2.9e-177) {
tmp = x + ((z * (y - x)) / (a - t));
} else if (t <= 7.5e+86) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = y / ((a - t) / (z - t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -120000000000.0) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); elseif (t <= -2.9e-177) tmp = Float64(x + Float64(Float64(z * Float64(y - x)) / Float64(a - t))); elseif (t <= 7.5e+86) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = Float64(y / Float64(Float64(a - t) / Float64(z - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -120000000000.0], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, -2.9e-177], N[(x + N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+86], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -120000000000:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-177}:\\
\;\;\;\;x + \frac{z \cdot \left(y - x\right)}{a - t}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a - t}{z - t}}\\
\end{array}
\end{array}
if t < -1.2e11Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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-*.f6451.2
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.2
Applied rewrites51.2%
if -1.2e11 < t < -2.89999999999999997e-177Initial program 67.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6454.2
Applied rewrites54.2%
if -2.89999999999999997e-177 < t < 7.4999999999999997e86Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in t around 0
lower-/.f6448.0
Applied rewrites48.0%
if 7.4999999999999997e86 < t Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.5e-34) (* (/ (- z t) (- a t)) y) (if (<= t 7.5e+86) (fma (/ z a) (- y x) x) (/ y (/ (- a t) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e-34) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 7.5e+86) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = y / ((a - t) / (z - t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e-34) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); elseif (t <= 7.5e+86) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = Float64(y / Float64(Float64(a - t) / Float64(z - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e-34], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 7.5e+86], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a - t}{z - t}}\\
\end{array}
\end{array}
if t < -7.5000000000000004e-34Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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-*.f6451.2
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.2
Applied rewrites51.2%
if -7.5000000000000004e-34 < t < 7.4999999999999997e86Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in t around 0
lower-/.f6448.0
Applied rewrites48.0%
if 7.4999999999999997e86 < t Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- z t) (- a t)) y))) (if (<= t -7.5e-34) t_1 (if (<= t 7.5e+86) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -7.5e-34) {
tmp = t_1;
} else if (t <= 7.5e+86) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y) tmp = 0.0 if (t <= -7.5e-34) tmp = t_1; elseif (t <= 7.5e+86) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -7.5e-34], t$95$1, If[LessEqual[t, 7.5e+86], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.5000000000000004e-34 or 7.4999999999999997e86 < t Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/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-*.f6451.2
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.2
Applied rewrites51.2%
if -7.5000000000000004e-34 < t < 7.4999999999999997e86Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in t around 0
lower-/.f6448.0
Applied rewrites48.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (- z t) (/ y (- a t))))) (if (<= t -7.5e-34) t_1 (if (<= t 9.6e+86) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (a - t));
double tmp;
if (t <= -7.5e-34) {
tmp = t_1;
} else if (t <= 9.6e+86) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * Float64(y / Float64(a - t))) tmp = 0.0 if (t <= -7.5e-34) tmp = t_1; elseif (t <= 9.6e+86) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e-34], t$95$1, If[LessEqual[t, 9.6e+86], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.5000000000000004e-34 or 9.6000000000000001e86 < t Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6445.9
Applied rewrites45.9%
if -7.5000000000000004e-34 < t < 9.6000000000000001e86Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in t around 0
lower-/.f6448.0
Applied rewrites48.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ z a) (- y x) x))) (if (<= z -1.95e-57) t_1 (if (<= z 1.9e+94) (fma (/ t (- t a)) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((z / a), (y - x), x);
double tmp;
if (z <= -1.95e-57) {
tmp = t_1;
} else if (z <= 1.9e+94) {
tmp = fma((t / (t - a)), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(z / a), Float64(y - x), x) tmp = 0.0 if (z <= -1.95e-57) tmp = t_1; elseif (z <= 1.9e+94) tmp = fma(Float64(t / Float64(t - a)), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.95e-57], t$95$1, If[LessEqual[z, 1.9e+94], N[(N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{t - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.95000000000000003e-57 or 1.8999999999999998e94 < z Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in t around 0
lower-/.f6448.0
Applied rewrites48.0%
if -1.95000000000000003e-57 < z < 1.8999999999999998e94Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in z around 0
Applied rewrites46.0%
Taylor expanded in x around 0
Applied rewrites44.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y x) x)))
(if (<= t -4.7e+151)
t_1
(if (<= t 2.05e+103) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / x) * x;
double tmp;
if (t <= -4.7e+151) {
tmp = t_1;
} else if (t <= 2.05e+103) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / x) * x) tmp = 0.0 if (t <= -4.7e+151) tmp = t_1; elseif (t <= 2.05e+103) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -4.7e+151], t$95$1, If[LessEqual[t, 2.05e+103], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{x} \cdot x\\
\mathbf{if}\;t \leq -4.7 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{+103}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.69999999999999989e151 or 2.0500000000000001e103 < t Initial program 67.5%
lift-+.f64N/A
sum-to-multN/A
lower-*.f64N/A
Applied rewrites62.8%
Taylor expanded in t around inf
lower-/.f6422.5
Applied rewrites22.5%
if -4.69999999999999989e151 < t < 2.0500000000000001e103Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in t around 0
lower-/.f6448.0
Applied rewrites48.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y x) x))) (if (<= t -4.7e+151) t_1 (if (<= t 2.05e+103) (fma (/ z a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / x) * x;
double tmp;
if (t <= -4.7e+151) {
tmp = t_1;
} else if (t <= 2.05e+103) {
tmp = fma((z / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / x) * x) tmp = 0.0 if (t <= -4.7e+151) tmp = t_1; elseif (t <= 2.05e+103) tmp = fma(Float64(z / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -4.7e+151], t$95$1, If[LessEqual[t, 2.05e+103], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{x} \cdot x\\
\mathbf{if}\;t \leq -4.7 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{+103}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.69999999999999989e151 or 2.0500000000000001e103 < t Initial program 67.5%
lift-+.f64N/A
sum-to-multN/A
lower-*.f64N/A
Applied rewrites62.8%
Taylor expanded in t around inf
lower-/.f6422.5
Applied rewrites22.5%
if -4.69999999999999989e151 < t < 2.0500000000000001e103Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Taylor expanded in t around 0
lower-/.f6448.0
Applied rewrites48.0%
Taylor expanded in x around 0
Applied rewrites39.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.2e+45) (* 1.0 x) (if (<= a 3.25e-12) (* (/ y x) x) (* 1.0 x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.2e+45) {
tmp = 1.0 * x;
} else if (a <= 3.25e-12) {
tmp = (y / x) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.2d+45)) then
tmp = 1.0d0 * x
else if (a <= 3.25d-12) then
tmp = (y / x) * x
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.2e+45) {
tmp = 1.0 * x;
} else if (a <= 3.25e-12) {
tmp = (y / x) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.2e+45: tmp = 1.0 * x elif a <= 3.25e-12: tmp = (y / x) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.2e+45) tmp = Float64(1.0 * x); elseif (a <= 3.25e-12) tmp = Float64(Float64(y / x) * x); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.2e+45) tmp = 1.0 * x; elseif (a <= 3.25e-12) tmp = (y / x) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.2e+45], N[(1.0 * x), $MachinePrecision], If[LessEqual[a, 3.25e-12], N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+45}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;a \leq 3.25 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if a < -1.19999999999999995e45 or 3.2500000000000001e-12 < a Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Applied rewrites66.2%
Taylor expanded in a around inf
Applied rewrites24.2%
if -1.19999999999999995e45 < a < 3.2500000000000001e-12Initial program 67.5%
lift-+.f64N/A
sum-to-multN/A
lower-*.f64N/A
Applied rewrites62.8%
Taylor expanded in t around inf
lower-/.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a) :precision binary64 (if (<= z 4.9e+147) (* 1.0 x) (* (/ z a) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.9e+147) {
tmp = 1.0 * x;
} else {
tmp = (z / a) * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 4.9d+147) then
tmp = 1.0d0 * x
else
tmp = (z / a) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.9e+147) {
tmp = 1.0 * x;
} else {
tmp = (z / a) * y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 4.9e+147: tmp = 1.0 * x else: tmp = (z / a) * y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 4.9e+147) tmp = Float64(1.0 * x); else tmp = Float64(Float64(z / a) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 4.9e+147) tmp = 1.0 * x; else tmp = (z / a) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 4.9e+147], N[(1.0 * x), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.9 \cdot 10^{+147}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\end{array}
\end{array}
if z < 4.8999999999999998e147Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Applied rewrites66.2%
Taylor expanded in a around inf
Applied rewrites24.2%
if 4.8999999999999998e147 < z Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6416.2
Applied rewrites16.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6418.7
Applied rewrites18.7%
(FPCore (x y z t a) :precision binary64 (if (<= z 4.9e+147) (* 1.0 x) (* z (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.9e+147) {
tmp = 1.0 * x;
} else {
tmp = z * (y / a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 4.9d+147) then
tmp = 1.0d0 * x
else
tmp = z * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.9e+147) {
tmp = 1.0 * x;
} else {
tmp = z * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 4.9e+147: tmp = 1.0 * x else: tmp = z * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 4.9e+147) tmp = Float64(1.0 * x); else tmp = Float64(z * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 4.9e+147) tmp = 1.0 * x; else tmp = z * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 4.9e+147], N[(1.0 * x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.9 \cdot 10^{+147}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < 4.8999999999999998e147Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Applied rewrites66.2%
Taylor expanded in a around inf
Applied rewrites24.2%
if 4.8999999999999998e147 < z Initial program 67.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.1
Applied rewrites39.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6416.2
Applied rewrites16.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6417.8
Applied rewrites17.8%
(FPCore (x y z t a) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a) {
return 1.0 * x;
}
def code(x, y, z, t, a): return 1.0 * x
function code(x, y, z, t, a) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 67.5%
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--.f6483.4
Applied rewrites83.4%
Applied rewrites66.2%
Taylor expanded in a around inf
Applied rewrites24.2%
herbie shell --seed 2025142
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y x) (- z t)) (- a t))))