
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ a (+ -1.0 (- z t))) (- y z) x))
(t_2 (+ (- t z) 1.0))
(t_3 (/ (- y z) (/ t_2 a))))
(if (<= t_3 -4e-108)
t_1
(if (<= t_3 0.0) (+ x (* (* a (- y z)) (/ -1.0 t_2))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((a / (-1.0 + (z - t))), (y - z), x);
double t_2 = (t - z) + 1.0;
double t_3 = (y - z) / (t_2 / a);
double tmp;
if (t_3 <= -4e-108) {
tmp = t_1;
} else if (t_3 <= 0.0) {
tmp = x + ((a * (y - z)) * (-1.0 / t_2));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(a / Float64(-1.0 + Float64(z - t))), Float64(y - z), x) t_2 = Float64(Float64(t - z) + 1.0) t_3 = Float64(Float64(y - z) / Float64(t_2 / a)) tmp = 0.0 if (t_3 <= -4e-108) tmp = t_1; elseif (t_3 <= 0.0) tmp = Float64(x + Float64(Float64(a * Float64(y - z)) * Float64(-1.0 / t_2))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - z), $MachinePrecision] / N[(t$95$2 / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -4e-108], t$95$1, If[LessEqual[t$95$3, 0.0], N[(x + N[(N[(a * N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{a}{-1 + \left(z - t\right)}, y - z, x\right)\\
t_2 := \left(t - z\right) + 1\\
t_3 := \frac{y - z}{\frac{t\_2}{a}}\\
\mathbf{if}\;t\_3 \leq -4 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;x + \left(a \cdot \left(y - z\right)\right) \cdot \frac{-1}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -4.00000000000000016e-108 or -0.0 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-fma.f64N/A
Applied rewrites99.9%
if -4.00000000000000016e-108 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -0.0Initial program 85.9%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
associate-*l/N/A
div-invN/A
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-*.f64N/A
lower-*.f64N/A
clear-numN/A
flip3-+N/A
lift-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.6e+34)
(- x a)
(if (<= z -7.6e-103)
(- x (/ (* a y) t))
(if (<= z 1.0) (fma (- y z) (- (fma a z a)) x) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.6e+34) {
tmp = x - a;
} else if (z <= -7.6e-103) {
tmp = x - ((a * y) / t);
} else if (z <= 1.0) {
tmp = fma((y - z), -fma(a, z, a), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.6e+34) tmp = Float64(x - a); elseif (z <= -7.6e-103) tmp = Float64(x - Float64(Float64(a * y) / t)); elseif (z <= 1.0) tmp = fma(Float64(y - z), Float64(-fma(a, z, a)), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.6e+34], N[(x - a), $MachinePrecision], If[LessEqual[z, -7.6e-103], N[(x - N[(N[(a * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y - z), $MachinePrecision] * (-N[(a * z + a), $MachinePrecision]) + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+34}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-103}:\\
\;\;\;\;x - \frac{a \cdot y}{t}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\mathsf{fma}\left(y - z, -\mathsf{fma}\left(a, z, a\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.5999999999999996e34 or 1 < z Initial program 91.6%
Taylor expanded in z around inf
lower--.f6473.1
Applied rewrites73.1%
if -4.5999999999999996e34 < z < -7.6000000000000001e-103Initial program 96.9%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6479.4
Applied rewrites79.4%
Taylor expanded in y around inf
Applied rewrites79.2%
if -7.6000000000000001e-103 < z < 1Initial program 98.9%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6476.8
Applied rewrites76.8%
Taylor expanded in z around 0
Applied rewrites76.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- a) (/ (- y z) t) x)))
(if (<= t -5e+160)
t_1
(if (<= t 2.9e+158) (fma a (/ (- y z) (+ z -1.0)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-a, ((y - z) / t), x);
double tmp;
if (t <= -5e+160) {
tmp = t_1;
} else if (t <= 2.9e+158) {
tmp = fma(a, ((y - z) / (z + -1.0)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-a), Float64(Float64(y - z) / t), x) tmp = 0.0 if (t <= -5e+160) tmp = t_1; elseif (t <= 2.9e+158) tmp = fma(a, Float64(Float64(y - z) / Float64(z + -1.0)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-a) * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -5e+160], t$95$1, If[LessEqual[t, 2.9e+158], N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, \frac{y - z}{t}, x\right)\\
\mathbf{if}\;t \leq -5 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y - z}{z + -1}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.0000000000000002e160 or 2.90000000000000024e158 < t Initial program 92.1%
Taylor expanded in z around inf
lower--.f6449.1
Applied rewrites49.1%
Taylor expanded in t around inf
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6489.9
Applied rewrites89.9%
if -5.0000000000000002e160 < t < 2.90000000000000024e158Initial program 96.5%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6493.2
Applied rewrites93.2%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
lower-+.f6495.6
Applied rewrites95.6%
Final simplification94.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ a (/ (+ (- t z) 1.0) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
real(8) function code(x, y, z, t, a)
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 + (a / (((t - z) + 1.0d0) / (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
def code(x, y, z, t, a): return x + (a / (((t - z) + 1.0) / (z - y)))
function code(x, y, z, t, a) return Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a / (((t - z) + 1.0) / (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\frac{\left(t - z\right) + 1}{z - y}}
\end{array}
Initial program 95.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
Final simplification99.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ a z) x)))
(if (<= z -2.6e+56)
t_1
(if (<= z 4.8e+26) (fma a (/ y (- -1.0 t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (a / z), x);
double tmp;
if (z <= -2.6e+56) {
tmp = t_1;
} else if (z <= 4.8e+26) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(a / z), x) tmp = 0.0 if (z <= -2.6e+56) tmp = t_1; elseif (z <= 4.8e+26) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -2.6e+56], t$95$1, If[LessEqual[z, 4.8e+26], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{a}{z}, x\right)\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.60000000000000011e56 or 4.80000000000000009e26 < z Initial program 90.9%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6487.5
Applied rewrites87.5%
Taylor expanded in z around inf
Applied rewrites87.5%
if -2.60000000000000011e56 < z < 4.80000000000000009e26Initial program 98.6%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6491.5
Applied rewrites91.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85e+62) (- x a) (if (<= z 3.5e+27) (fma a (/ y (- -1.0 t)) x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+62) {
tmp = x - a;
} else if (z <= 3.5e+27) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+62) tmp = Float64(x - a); elseif (z <= 3.5e+27) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+62], N[(x - a), $MachinePrecision], If[LessEqual[z, 3.5e+27], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+62}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.85000000000000007e62 or 3.5000000000000002e27 < z Initial program 90.8%
Taylor expanded in z around inf
lower--.f6475.0
Applied rewrites75.0%
if -1.85000000000000007e62 < z < 3.5000000000000002e27Initial program 98.6%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6490.9
Applied rewrites90.9%
(FPCore (x y z t a) :precision binary64 (fma (/ a (+ -1.0 (- z t))) (- y z) x))
double code(double x, double y, double z, double t, double a) {
return fma((a / (-1.0 + (z - t))), (y - z), x);
}
function code(x, y, z, t, a) return fma(Float64(a / Float64(-1.0 + Float64(z - t))), Float64(y - z), x) end
code[x_, y_, z_, t_, a_] := N[(N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{a}{-1 + \left(z - t\right)}, y - z, x\right)
\end{array}
Initial program 95.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-fma.f64N/A
Applied rewrites96.0%
Final simplification96.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.8e+39) (- x a) (if (<= z 1.0) (fma (- y z) (- a) x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+39) {
tmp = x - a;
} else if (z <= 1.0) {
tmp = fma((y - z), -a, x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+39) tmp = Float64(x - a); elseif (z <= 1.0) tmp = fma(Float64(y - z), Float64(-a), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+39], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y - z), $MachinePrecision] * (-a) + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+39}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\mathsf{fma}\left(y - z, -a, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -2.80000000000000001e39 or 1 < z Initial program 91.5%
Taylor expanded in z around inf
lower--.f6473.5
Applied rewrites73.5%
if -2.80000000000000001e39 < z < 1Initial program 98.5%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6475.0
Applied rewrites75.0%
Taylor expanded in z around 0
Applied rewrites72.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85e+62) (- x a) (if (<= z 4.6e+26) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+62) {
tmp = x - a;
} else if (z <= 4.6e+26) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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.85d+62)) then
tmp = x - a
else if (z <= 4.6d+26) then
tmp = x - (a * y)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+62) {
tmp = x - a;
} else if (z <= 4.6e+26) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85e+62: tmp = x - a elif z <= 4.6e+26: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+62) tmp = Float64(x - a); elseif (z <= 4.6e+26) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.85e+62) tmp = x - a; elseif (z <= 4.6e+26) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+62], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.6e+26], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+62}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+26}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.85000000000000007e62 or 4.6000000000000001e26 < z Initial program 90.8%
Taylor expanded in z around inf
lower--.f6475.0
Applied rewrites75.0%
if -1.85000000000000007e62 < z < 4.6000000000000001e26Initial program 98.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6474.5
Applied rewrites74.5%
Taylor expanded in z around 0
Applied rewrites69.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -9e+34) (- x a) (if (<= z 4.6e+26) (- (- x)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e+34) {
tmp = x - a;
} else if (z <= 4.6e+26) {
tmp = -(-x);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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 <= (-9d+34)) then
tmp = x - a
else if (z <= 4.6d+26) then
tmp = -(-x)
else
tmp = x - 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 <= -9e+34) {
tmp = x - a;
} else if (z <= 4.6e+26) {
tmp = -(-x);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9e+34: tmp = x - a elif z <= 4.6e+26: tmp = -(-x) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9e+34) tmp = Float64(x - a); elseif (z <= 4.6e+26) tmp = Float64(-Float64(-x)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9e+34) tmp = x - a; elseif (z <= 4.6e+26) tmp = -(-x); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9e+34], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.6e+26], (-(-x)), N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+34}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+26}:\\
\;\;\;\;-\left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -9.0000000000000001e34 or 4.6000000000000001e26 < z Initial program 91.4%
Taylor expanded in z around inf
lower--.f6473.1
Applied rewrites73.1%
if -9.0000000000000001e34 < z < 4.6000000000000001e26Initial program 98.5%
Taylor expanded in z around inf
lower--.f6447.4
Applied rewrites47.4%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites86.3%
Taylor expanded in x around inf
Applied rewrites61.1%
(FPCore (x y z t a) :precision binary64 (- x a))
double code(double x, double y, double z, double t, double a) {
return x - a;
}
real(8) function code(x, y, z, t, a)
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 - a
end function
public static double code(double x, double y, double z, double t, double a) {
return x - a;
}
def code(x, y, z, t, a): return x - a
function code(x, y, z, t, a) return Float64(x - a) end
function tmp = code(x, y, z, t, a) tmp = x - a; end
code[x_, y_, z_, t_, a_] := N[(x - a), $MachinePrecision]
\begin{array}{l}
\\
x - a
\end{array}
Initial program 95.3%
Taylor expanded in z around inf
lower--.f6459.0
Applied rewrites59.0%
(FPCore (x y z t a) :precision binary64 (- a))
double code(double x, double y, double z, double t, double a) {
return -a;
}
real(8) function code(x, y, z, t, a)
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 = -a
end function
public static double code(double x, double y, double z, double t, double a) {
return -a;
}
def code(x, y, z, t, a): return -a
function code(x, y, z, t, a) return Float64(-a) end
function tmp = code(x, y, z, t, a) tmp = -a; end
code[x_, y_, z_, t_, a_] := (-a)
\begin{array}{l}
\\
-a
\end{array}
Initial program 95.3%
Taylor expanded in z around inf
lower--.f6459.0
Applied rewrites59.0%
Taylor expanded in x around 0
Applied rewrites16.4%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
real(8) function code(x, y, z, t, a)
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 - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024238
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))