
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(-
(* (/ (- a t) z) (/ y (pow (- b y) 2.0)))
(/ (fma (/ x z) y (- t a)) (- y b))))
(t_2 (fma (- b y) z y))
(t_3 (/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y)))
(t_4 (fma z (/ (- t a) t_2) (* (/ x t_2) y))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -5e-303)
t_3
(if (<= t_3 0.0)
t_1
(if (<= t_3 4e+295) t_3 (if (<= t_3 INFINITY) t_4 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a - t) / z) * (y / pow((b - y), 2.0))) - (fma((x / z), y, (t - a)) / (y - b));
double t_2 = fma((b - y), z, y);
double t_3 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double t_4 = fma(z, ((t - a) / t_2), ((x / t_2) * y));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -5e-303) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_1;
} else if (t_3 <= 4e+295) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a - t) / z) * Float64(y / (Float64(b - y) ^ 2.0))) - Float64(fma(Float64(x / z), y, Float64(t - a)) / Float64(y - b))) t_2 = fma(Float64(b - y), z, y) t_3 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) t_4 = fma(z, Float64(Float64(t - a) / t_2), Float64(Float64(x / t_2) * y)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -5e-303) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_1; elseif (t_3 <= 4e+295) tmp = t_3; elseif (t_3 <= Inf) tmp = t_4; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision] * N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x / z), $MachinePrecision] * y + N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(x / t$95$2), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -5e-303], t$95$3, If[LessEqual[t$95$3, 0.0], t$95$1, If[LessEqual[t$95$3, 4e+295], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{z} \cdot \frac{y}{{\left(b - y\right)}^{2}} - \frac{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}{y - b}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
t_4 := \mathsf{fma}\left(z, \frac{t - a}{t\_2}, \frac{x}{t\_2} \cdot y\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-303}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+295}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 3.9999999999999999e295 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 41.1%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6497.5
lift-+.f64N/A
Applied rewrites97.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999998e-303 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 3.9999999999999999e295Initial program 99.4%
if -4.9999999999999998e-303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.6%
Taylor expanded in z around inf
associate--r+N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
times-fracN/A
associate-*r/N/A
div-subN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
Applied rewrites85.0%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y)))
(t_3 (fma z (/ (- t a) t_1) (* (/ x t_1) y))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 4e+295) t_2 (if (<= t_2 INFINITY) t_3 (/ (- a t) (- y b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double t_3 = fma(z, ((t - a) / t_1), ((x / t_1) * y));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 4e+295) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (a - t) / (y - b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) t_3 = fma(z, Float64(Float64(t - a) / t_1), Float64(Float64(x / t_1) * y)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 4e+295) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(Float64(a - t) / Float64(y - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(x / t$95$1), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 4e+295], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
t_3 := \mathsf{fma}\left(z, \frac{t - a}{t\_1}, \frac{x}{t\_1} \cdot y\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+295}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{a - t}{y - b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 3.9999999999999999e295 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 41.1%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6497.5
lift-+.f64N/A
Applied rewrites97.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 3.9999999999999999e295Initial program 92.7%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.7
Applied rewrites72.7%
Final simplification91.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ z (fma (- b y) z y)) (- t a))) (t_2 (/ (- a t) (- y b))))
(if (<= z -7.4e+25)
t_2
(if (<= z -2.4e-97)
t_1
(if (<= z 7.5e-154)
(fma (/ (- a) y) z x)
(if (<= z 6.2e+20) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / fma((b - y), z, y)) * (t - a);
double t_2 = (a - t) / (y - b);
double tmp;
if (z <= -7.4e+25) {
tmp = t_2;
} else if (z <= -2.4e-97) {
tmp = t_1;
} else if (z <= 7.5e-154) {
tmp = fma((-a / y), z, x);
} else if (z <= 6.2e+20) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / fma(Float64(b - y), z, y)) * Float64(t - a)) t_2 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -7.4e+25) tmp = t_2; elseif (z <= -2.4e-97) tmp = t_1; elseif (z <= 7.5e-154) tmp = fma(Float64(Float64(-a) / y), z, x); elseif (z <= 6.2e+20) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+25], t$95$2, If[LessEqual[z, -2.4e-97], t$95$1, If[LessEqual[z, 7.5e-154], N[(N[((-a) / y), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 6.2e+20], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{\mathsf{fma}\left(b - y, z, y\right)} \cdot \left(t - a\right)\\
t_2 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{+25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-154}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-a}{y}, z, x\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -7.3999999999999998e25 or 6.2e20 < z Initial program 49.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.4
Applied rewrites83.4%
if -7.3999999999999998e25 < z < -2.4e-97 or 7.5e-154 < z < 6.2e20Initial program 92.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6469.5
Applied rewrites69.5%
if -2.4e-97 < z < 7.5e-154Initial program 89.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites64.0%
Taylor expanded in a around inf
Applied rewrites68.6%
Final simplification75.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -6.6e+21)
t_1
(if (<= z 2.05e+18)
(/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -6.6e+21) {
tmp = t_1;
} else if (z <= 2.05e+18) {
tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a - t) / (y - b)
if (z <= (-6.6d+21)) then
tmp = t_1
else if (z <= 2.05d+18) then
tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -6.6e+21) {
tmp = t_1;
} else if (z <= 2.05e+18) {
tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - t) / (y - b) tmp = 0 if z <= -6.6e+21: tmp = t_1 elif z <= 2.05e+18: tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -6.6e+21) tmp = t_1; elseif (z <= 2.05e+18) tmp = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - t) / (y - b); tmp = 0.0; if (z <= -6.6e+21) tmp = t_1; elseif (z <= 2.05e+18) tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+21], t$95$1, If[LessEqual[z, 2.05e+18], N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+18}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.6e21 or 2.05e18 < z Initial program 49.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.1
Applied rewrites83.1%
if -6.6e21 < z < 2.05e18Initial program 91.9%
Final simplification87.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -4.2e-31)
t_1
(if (<= z 9.5e-26) (/ (fma t z (* y x)) (+ (* (- b y) z) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -4.2e-31) {
tmp = t_1;
} else if (z <= 9.5e-26) {
tmp = fma(t, z, (y * x)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -4.2e-31) tmp = t_1; elseif (z <= 9.5e-26) tmp = Float64(fma(t, z, Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-31], t$95$1, If[LessEqual[z, 9.5e-26], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.19999999999999982e-31 or 9.4999999999999995e-26 < z Initial program 54.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.1
Applied rewrites80.1%
if -4.19999999999999982e-31 < z < 9.4999999999999995e-26Initial program 91.7%
Taylor expanded in a around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6469.4
Applied rewrites69.4%
Final simplification75.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -4.2e-31)
t_1
(if (<= z 9.5e-26) (/ (fma t z (* y x)) (fma (- b y) z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -4.2e-31) {
tmp = t_1;
} else if (z <= 9.5e-26) {
tmp = fma(t, z, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -4.2e-31) tmp = t_1; elseif (z <= 9.5e-26) tmp = Float64(fma(t, z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-31], t$95$1, If[LessEqual[z, 9.5e-26], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.19999999999999982e-31 or 9.4999999999999995e-26 < z Initial program 54.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.1
Applied rewrites80.1%
if -4.19999999999999982e-31 < z < 9.4999999999999995e-26Initial program 91.7%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6469.4
Applied rewrites69.4%
Final simplification75.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -3.6e-97)
t_1
(if (<= z 6e-27) (fma (/ (- t (fma b x a)) y) z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -3.6e-97) {
tmp = t_1;
} else if (z <= 6e-27) {
tmp = fma(((t - fma(b, x, a)) / y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -3.6e-97) tmp = t_1; elseif (z <= 6e-27) tmp = fma(Float64(Float64(t - fma(b, x, a)) / y), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-97], t$95$1, If[LessEqual[z, 6e-27], N[(N[(N[(t - N[(b * x + a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - \mathsf{fma}\left(b, x, a\right)}{y}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.59999999999999997e-97 or 6.0000000000000002e-27 < z Initial program 59.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6476.6
Applied rewrites76.6%
if -3.59999999999999997e-97 < z < 6.0000000000000002e-27Initial program 90.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.2%
Taylor expanded in y around 0
Applied rewrites63.1%
Final simplification71.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -3.6e-97)
t_1
(if (<= z 2.75e-33) (fma x z x) (if (<= z 4.2e+30) (/ (- a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -3.6e-97) {
tmp = t_1;
} else if (z <= 2.75e-33) {
tmp = fma(x, z, x);
} else if (z <= 4.2e+30) {
tmp = -a / b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -3.6e-97) tmp = t_1; elseif (z <= 2.75e-33) tmp = fma(x, z, x); elseif (z <= 4.2e+30) tmp = Float64(Float64(-a) / b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-97], t$95$1, If[LessEqual[z, 2.75e-33], N[(x * z + x), $MachinePrecision], If[LessEqual[z, 4.2e+30], N[((-a) / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.59999999999999997e-97 or 4.2e30 < z Initial program 57.6%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6440.1
Applied rewrites40.1%
Taylor expanded in z around inf
Applied rewrites53.5%
if -3.59999999999999997e-97 < z < 2.75e-33Initial program 90.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.2%
Taylor expanded in y around inf
Applied rewrites49.9%
if 2.75e-33 < z < 4.2e30Initial program 78.8%
Taylor expanded in a around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6458.6
Applied rewrites58.6%
Taylor expanded in y around 0
Applied rewrites43.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.6e-97) (/ t b) (if (<= z 2.75e-33) (fma x z x) (if (<= z 1.55e+32) (/ (- a) b) (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.6e-97) {
tmp = t / b;
} else if (z <= 2.75e-33) {
tmp = fma(x, z, x);
} else if (z <= 1.55e+32) {
tmp = -a / b;
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.6e-97) tmp = Float64(t / b); elseif (z <= 2.75e-33) tmp = fma(x, z, x); elseif (z <= 1.55e+32) tmp = Float64(Float64(-a) / b); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.6e-97], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.75e-33], N[(x * z + x), $MachinePrecision], If[LessEqual[z, 1.55e+32], N[((-a) / b), $MachinePrecision], N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-97}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+32}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -3.59999999999999997e-97 or 1.54999999999999997e32 < z Initial program 57.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6439.2
Applied rewrites39.2%
Taylor expanded in y around 0
Applied rewrites33.7%
if -3.59999999999999997e-97 < z < 2.75e-33Initial program 90.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.2%
Taylor expanded in y around inf
Applied rewrites49.9%
if 2.75e-33 < z < 1.54999999999999997e32Initial program 81.3%
Taylor expanded in a around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in y around 0
Applied rewrites38.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- a t) (- y b)))) (if (<= z -3.6e-97) t_1 (if (<= z 1.5e-27) (fma (/ (- a) y) z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -3.6e-97) {
tmp = t_1;
} else if (z <= 1.5e-27) {
tmp = fma((-a / y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -3.6e-97) tmp = t_1; elseif (z <= 1.5e-27) tmp = fma(Float64(Float64(-a) / y), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-97], t$95$1, If[LessEqual[z, 1.5e-27], N[(N[((-a) / y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-a}{y}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.59999999999999997e-97 or 1.5000000000000001e-27 < z Initial program 59.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6476.6
Applied rewrites76.6%
if -3.59999999999999997e-97 < z < 1.5000000000000001e-27Initial program 90.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.2%
Taylor expanded in a around inf
Applied rewrites62.5%
Final simplification71.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- a t) (- y b)))) (if (<= z -3.6e-97) t_1 (if (<= z 2.9e-132) (fma (/ t y) z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -3.6e-97) {
tmp = t_1;
} else if (z <= 2.9e-132) {
tmp = fma((t / y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -3.6e-97) tmp = t_1; elseif (z <= 2.9e-132) tmp = fma(Float64(t / y), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-97], t$95$1, If[LessEqual[z, 2.9e-132], N[(N[(t / y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-132}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.59999999999999997e-97 or 2.89999999999999983e-132 < z Initial program 63.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.6
Applied rewrites72.6%
if -3.59999999999999997e-97 < z < 2.89999999999999983e-132Initial program 89.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites63.9%
Taylor expanded in t around inf
Applied rewrites64.2%
Final simplification69.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- a t) (- y b)))) (if (<= z -2.8e-97) t_1 (if (<= z 2.7e-150) (* 1.0 x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -2.8e-97) {
tmp = t_1;
} else if (z <= 2.7e-150) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a - t) / (y - b)
if (z <= (-2.8d-97)) then
tmp = t_1
else if (z <= 2.7d-150) then
tmp = 1.0d0 * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -2.8e-97) {
tmp = t_1;
} else if (z <= 2.7e-150) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - t) / (y - b) tmp = 0 if z <= -2.8e-97: tmp = t_1 elif z <= 2.7e-150: tmp = 1.0 * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -2.8e-97) tmp = t_1; elseif (z <= 2.7e-150) tmp = Float64(1.0 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - t) / (y - b); tmp = 0.0; if (z <= -2.8e-97) tmp = t_1; elseif (z <= 2.7e-150) tmp = 1.0 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e-97], t$95$1, If[LessEqual[z, 2.7e-150], N[(1.0 * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-150}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8000000000000002e-97 or 2.7000000000000001e-150 < z Initial program 64.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6471.0
Applied rewrites71.0%
if -2.8000000000000002e-97 < z < 2.7000000000000001e-150Initial program 89.6%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
lower-/.f6489.5
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6489.5
Applied rewrites89.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6471.3
Applied rewrites71.3%
Taylor expanded in z around 0
Applied rewrites56.4%
Final simplification66.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.95e+71) t_1 (if (<= y 1.06e+92) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.95e+71) {
tmp = t_1;
} else if (y <= 1.06e+92) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-1.95d+71)) then
tmp = t_1
else if (y <= 1.06d+92) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.95e+71) {
tmp = t_1;
} else if (y <= 1.06e+92) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.95e+71: tmp = t_1 elif y <= 1.06e+92: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.95e+71) tmp = t_1; elseif (y <= 1.06e+92) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.95e+71) tmp = t_1; elseif (y <= 1.06e+92) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e+71], t$95$1, If[LessEqual[y, 1.06e+92], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+92}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.9500000000000001e71 or 1.05999999999999999e92 < y Initial program 58.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.7
Applied rewrites57.7%
if -1.9500000000000001e71 < y < 1.05999999999999999e92Initial program 79.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -3.6e-97) t_1 (if (<= z 3.6e+21) (/ x (- 1.0 z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -3.6e-97) {
tmp = t_1;
} else if (z <= 3.6e+21) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-3.6d-97)) then
tmp = t_1
else if (z <= 3.6d+21) then
tmp = x / (1.0d0 - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -3.6e-97) {
tmp = t_1;
} else if (z <= 3.6e+21) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -3.6e-97: tmp = t_1 elif z <= 3.6e+21: tmp = x / (1.0 - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -3.6e-97) tmp = t_1; elseif (z <= 3.6e+21) tmp = Float64(x / Float64(1.0 - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -3.6e-97) tmp = t_1; elseif (z <= 3.6e+21) tmp = x / (1.0 - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-97], t$95$1, If[LessEqual[z, 3.6e+21], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.59999999999999997e-97 or 3.6e21 < z Initial program 57.9%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6439.4
Applied rewrites39.4%
Taylor expanded in z around inf
Applied rewrites53.1%
if -3.59999999999999997e-97 < z < 3.6e21Initial program 89.6%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6447.9
Applied rewrites47.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.6e-97) (/ t b) (if (<= z 2.1e+18) (fma x z x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.6e-97) {
tmp = t / b;
} else if (z <= 2.1e+18) {
tmp = fma(x, z, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.6e-97) tmp = Float64(t / b); elseif (z <= 2.1e+18) tmp = fma(x, z, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.6e-97], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.1e+18], N[(x * z + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-97}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -3.59999999999999997e-97 or 2.1e18 < z Initial program 57.7%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6438.9
Applied rewrites38.9%
Taylor expanded in y around 0
Applied rewrites32.9%
if -3.59999999999999997e-97 < z < 2.1e18Initial program 90.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.4%
Taylor expanded in y around inf
Applied rewrites46.3%
(FPCore (x y z t a b) :precision binary64 (fma x z x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(x, z, x);
}
function code(x, y, z, t, a, b) return fma(x, z, x) end
code[x_, y_, z_, t_, a_, b_] := N[(x * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, z, x\right)
\end{array}
Initial program 71.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites31.5%
Taylor expanded in y around inf
Applied rewrites23.8%
(FPCore (x y z t a b) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
def code(x, y, z, t, a, b): return 1.0 * x
function code(x, y, z, t, a, b) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a, b) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_, b_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 71.8%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
lower-/.f6471.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6471.8
Applied rewrites71.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6458.9
Applied rewrites58.9%
Taylor expanded in z around 0
Applied rewrites23.3%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024298
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))