
(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 (/ (- t a) (- b y))))
(if (or (<= z -3.8e+35) (not (<= z 6500000.0)))
(+ (/ (* (/ y (- b y)) (- x t_1)) z) t_1)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if ((z <= -3.8e+35) || !(z <= 6500000.0)) {
tmp = (((y / (b - y)) * (x - t_1)) / z) + t_1;
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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 - a) / (b - y)
if ((z <= (-3.8d+35)) .or. (.not. (z <= 6500000.0d0))) then
tmp = (((y / (b - y)) * (x - t_1)) / z) + t_1
else
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
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 - a) / (b - y);
double tmp;
if ((z <= -3.8e+35) || !(z <= 6500000.0)) {
tmp = (((y / (b - y)) * (x - t_1)) / z) + t_1;
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if (z <= -3.8e+35) or not (z <= 6500000.0): tmp = (((y / (b - y)) * (x - t_1)) / z) + t_1 else: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if ((z <= -3.8e+35) || !(z <= 6500000.0)) tmp = Float64(Float64(Float64(Float64(y / Float64(b - y)) * Float64(x - t_1)) / z) + t_1); else tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if ((z <= -3.8e+35) || ~((z <= 6500000.0))) tmp = (((y / (b - y)) * (x - t_1)) / z) + t_1; else tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -3.8e+35], N[Not[LessEqual[z, 6500000.0]], $MachinePrecision]], N[(N[(N[(N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] * N[(x - t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t$95$1), $MachinePrecision], 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}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+35} \lor \neg \left(z \leq 6500000\right):\\
\;\;\;\;\frac{\frac{y}{b - y} \cdot \left(x - t\_1\right)}{z} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -3.8e35 or 6.5e6 < z Initial program 30.7%
Taylor expanded in z around inf
Applied rewrites97.4%
if -3.8e35 < z < 6.5e6Initial program 89.7%
Final simplification93.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (* (- t a) z) t_1))
(t_3 (/ (- t a) (- b y))))
(if (<= z -6.2e+34)
t_3
(if (<= z -6.6e-129)
t_2
(if (<= z 4.4e-252) (* (/ y t_1) x) (if (<= z 62000.0) t_2 t_3))))))
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) / t_1;
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -6.2e+34) {
tmp = t_3;
} else if (z <= -6.6e-129) {
tmp = t_2;
} else if (z <= 4.4e-252) {
tmp = (y / t_1) * x;
} else if (z <= 62000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(Float64(t - a) * z) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6.2e+34) tmp = t_3; elseif (z <= -6.6e-129) tmp = t_2; elseif (z <= 4.4e-252) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 62000.0) tmp = t_2; else tmp = t_3; 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[(t - a), $MachinePrecision] * z), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+34], t$95$3, If[LessEqual[z, -6.6e-129], t$95$2, If[LessEqual[z, 4.4e-252], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 62000.0], t$95$2, t$95$3]]]]]]]
\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}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+34}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-129}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-252}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 62000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -6.19999999999999955e34 or 62000 < z Initial program 31.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.2
Applied rewrites80.2%
if -6.19999999999999955e34 < z < -6.59999999999999977e-129 or 4.3999999999999998e-252 < z < 62000Initial program 93.0%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6493.0
Applied rewrites93.0%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if -6.59999999999999977e-129 < z < 4.3999999999999998e-252Initial program 80.7%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6476.7
Applied rewrites76.7%
Final simplification75.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ (- x) z) (/ (- t a) (- b y)))) (t_2 (fma (- b y) z y)))
(if (<= z -2.2e-7)
t_1
(if (<= z 7.5e-67)
(/ (fma t z (* y x)) t_2)
(if (<= z 62000.0) (/ (* (- t a) z) t_2) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (-x / z) + ((t - a) / (b - y));
double t_2 = fma((b - y), z, y);
double tmp;
if (z <= -2.2e-7) {
tmp = t_1;
} else if (z <= 7.5e-67) {
tmp = fma(t, z, (y * x)) / t_2;
} else if (z <= 62000.0) {
tmp = ((t - a) * z) / t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(-x) / z) + Float64(Float64(t - a) / Float64(b - y))) t_2 = fma(Float64(b - y), z, y) tmp = 0.0 if (z <= -2.2e-7) tmp = t_1; elseif (z <= 7.5e-67) tmp = Float64(fma(t, z, Float64(y * x)) / t_2); elseif (z <= 62000.0) tmp = Float64(Float64(Float64(t - a) * z) / t_2); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[((-x) / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, If[LessEqual[z, -2.2e-7], t$95$1, If[LessEqual[z, 7.5e-67], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[z, 62000.0], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z} + \frac{t - a}{b - y}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_2}\\
\mathbf{elif}\;z \leq 62000:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2000000000000001e-7 or 62000 < z Initial program 36.0%
Taylor expanded in z around inf
Applied rewrites94.6%
Taylor expanded in y around inf
Applied rewrites86.5%
if -2.2000000000000001e-7 < z < 7.5000000000000005e-67Initial program 87.4%
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--.f6467.3
Applied rewrites67.3%
if 7.5000000000000005e-67 < z < 62000Initial program 99.5%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification77.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e+17) (not (<= z 5600000000.0))) (+ (/ (- x) z) (/ (- t a) (- b y))) (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.2e+17) || !(z <= 5600000000.0)) {
tmp = (-x / z) + ((t - a) / (b - y));
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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) :: tmp
if ((z <= (-1.2d+17)) .or. (.not. (z <= 5600000000.0d0))) then
tmp = (-x / z) + ((t - a) / (b - y))
else
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.2e+17) || !(z <= 5600000000.0)) {
tmp = (-x / z) + ((t - a) / (b - y));
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.2e+17) or not (z <= 5600000000.0): tmp = (-x / z) + ((t - a) / (b - y)) else: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e+17) || !(z <= 5600000000.0)) tmp = Float64(Float64(Float64(-x) / z) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.2e+17) || ~((z <= 5600000000.0))) tmp = (-x / z) + ((t - a) / (b - y)); else tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.2e+17], N[Not[LessEqual[z, 5600000000.0]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+17} \lor \neg \left(z \leq 5600000000\right):\\
\;\;\;\;\frac{-x}{z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -1.2e17 or 5.6e9 < z Initial program 33.4%
Taylor expanded in z around inf
Applied rewrites95.9%
Taylor expanded in y around inf
Applied rewrites86.7%
if -1.2e17 < z < 5.6e9Initial program 89.9%
Final simplification88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -2e-7)
t_2
(if (<= z 7.5e-67)
(/ (fma t z (* y x)) t_1)
(if (<= z 62000.0) (/ (* (- t a) z) t_1) t_2)))))
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) / (b - y);
double tmp;
if (z <= -2e-7) {
tmp = t_2;
} else if (z <= 7.5e-67) {
tmp = fma(t, z, (y * x)) / t_1;
} else if (z <= 62000.0) {
tmp = ((t - a) * z) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2e-7) tmp = t_2; elseif (z <= 7.5e-67) tmp = Float64(fma(t, z, Float64(y * x)) / t_1); elseif (z <= 62000.0) tmp = Float64(Float64(Float64(t - a) * z) / t_1); else tmp = t_2; 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e-7], t$95$2, If[LessEqual[z, 7.5e-67], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 62000.0], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2 \cdot 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 62000:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.9999999999999999e-7 or 62000 < z Initial program 36.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.1
Applied rewrites80.1%
if -1.9999999999999999e-7 < z < 7.5000000000000005e-67Initial program 87.4%
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--.f6467.3
Applied rewrites67.3%
if 7.5000000000000005e-67 < z < 62000Initial program 99.5%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification74.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -220000000.0) (not (<= z 2.9e-14))) (/ (- t a) (- b y)) (fma (/ (- t a) y) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -220000000.0) || !(z <= 2.9e-14)) {
tmp = (t - a) / (b - y);
} else {
tmp = fma(((t - a) / y), z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -220000000.0) || !(z <= 2.9e-14)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = fma(Float64(Float64(t - a) / y), z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -220000000.0], N[Not[LessEqual[z, 2.9e-14]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -220000000 \lor \neg \left(z \leq 2.9 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{y}, z, x\right)\\
\end{array}
\end{array}
if z < -2.2e8 or 2.9000000000000003e-14 < z Initial program 37.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.2
Applied rewrites79.2%
if -2.2e8 < z < 2.9000000000000003e-14Initial program 89.3%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6465.9
Applied rewrites65.9%
Taylor expanded in z around 0
Applied rewrites65.7%
Taylor expanded in x around 0
Applied rewrites65.5%
Final simplification72.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2e+56)
(- (/ t y))
(if (<= z -8e-8)
(/ a y)
(if (<= z 1.4e-49) (fma (fma x z x) z x) (/ (- a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e+56) {
tmp = -(t / y);
} else if (z <= -8e-8) {
tmp = a / y;
} else if (z <= 1.4e-49) {
tmp = fma(fma(x, z, x), z, x);
} else {
tmp = -a / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e+56) tmp = Float64(-Float64(t / y)); elseif (z <= -8e-8) tmp = Float64(a / y); elseif (z <= 1.4e-49) tmp = fma(fma(x, z, x), z, x); else tmp = Float64(Float64(-a) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e+56], (-N[(t / y), $MachinePrecision]), If[LessEqual[z, -8e-8], N[(a / y), $MachinePrecision], If[LessEqual[z, 1.4e-49], N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision], N[((-a) / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+56}:\\
\;\;\;\;-\frac{t}{y}\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-8}:\\
\;\;\;\;\frac{a}{y}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-49}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if z < -2.00000000000000018e56Initial program 23.9%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6420.0
Applied rewrites20.0%
Taylor expanded in z around inf
Applied rewrites45.0%
Taylor expanded in t around inf
Applied rewrites30.4%
if -2.00000000000000018e56 < z < -8.0000000000000002e-8Initial program 87.1%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6464.7
Applied rewrites64.7%
Taylor expanded in z around inf
Applied rewrites45.5%
Taylor expanded in t around 0
Applied rewrites45.1%
if -8.0000000000000002e-8 < z < 1.39999999999999999e-49Initial program 87.9%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6444.7
Applied rewrites44.7%
Taylor expanded in z around 0
Applied rewrites44.7%
if 1.39999999999999999e-49 < z Initial program 48.7%
Taylor expanded in a around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6434.4
Applied rewrites34.4%
Taylor expanded in y around 0
Applied rewrites28.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e+288) (not (<= y 4.9e+86))) (/ x (- 1.0 z)) (/ (- t a) (- b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e+288) || !(y <= 4.9e+86)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
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) :: tmp
if ((y <= (-7.2d+288)) .or. (.not. (y <= 4.9d+86))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / (b - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e+288) || !(y <= 4.9e+86)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.2e+288) or not (y <= 4.9e+86): tmp = x / (1.0 - z) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.2e+288) || !(y <= 4.9e+86)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.2e+288) || ~((y <= 4.9e+86))) tmp = x / (1.0 - z); else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.2e+288], N[Not[LessEqual[y, 4.9e+86]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+288} \lor \neg \left(y \leq 4.9 \cdot 10^{+86}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if y < -7.2000000000000003e288 or 4.8999999999999999e86 < y Initial program 41.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6473.8
Applied rewrites73.8%
if -7.2000000000000003e288 < y < 4.8999999999999999e86Initial program 68.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6461.6
Applied rewrites61.6%
Final simplification64.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.2e+63) (not (<= y 4.6e+62))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.2e+63) || !(y <= 4.6e+62)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
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) :: tmp
if ((y <= (-1.2d+63)) .or. (.not. (y <= 4.6d+62))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.2e+63) || !(y <= 4.6e+62)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.2e+63) or not (y <= 4.6e+62): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.2e+63) || !(y <= 4.6e+62)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.2e+63) || ~((y <= 4.6e+62))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.2e+63], N[Not[LessEqual[y, 4.6e+62]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+63} \lor \neg \left(y \leq 4.6 \cdot 10^{+62}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.2e63 or 4.59999999999999968e62 < y Initial program 43.6%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.0
Applied rewrites57.0%
if -1.2e63 < y < 4.59999999999999968e62Initial program 75.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6450.5
Applied rewrites50.5%
Final simplification53.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.8e-63) (not (<= y 4.2e+86))) (/ x (- 1.0 z)) (/ (- a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.8e-63) || !(y <= 4.2e+86)) {
tmp = x / (1.0 - z);
} else {
tmp = -a / b;
}
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) :: tmp
if ((y <= (-6.8d-63)) .or. (.not. (y <= 4.2d+86))) then
tmp = x / (1.0d0 - z)
else
tmp = -a / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.8e-63) || !(y <= 4.2e+86)) {
tmp = x / (1.0 - z);
} else {
tmp = -a / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.8e-63) or not (y <= 4.2e+86): tmp = x / (1.0 - z) else: tmp = -a / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.8e-63) || !(y <= 4.2e+86)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(-a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.8e-63) || ~((y <= 4.2e+86))) tmp = x / (1.0 - z); else tmp = -a / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.8e-63], N[Not[LessEqual[y, 4.2e+86]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[((-a) / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-63} \lor \neg \left(y \leq 4.2 \cdot 10^{+86}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if y < -6.79999999999999997e-63 or 4.1999999999999998e86 < y Initial program 50.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6451.1
Applied rewrites51.1%
if -6.79999999999999997e-63 < y < 4.1999999999999998e86Initial program 74.9%
Taylor expanded in a around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
Applied rewrites34.7%
Final simplification42.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.8e-11) (not (<= z 0.31))) (/ (- a t) y) (/ x 1.0)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.8e-11) || !(z <= 0.31)) {
tmp = (a - t) / y;
} else {
tmp = x / 1.0;
}
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) :: tmp
if ((z <= (-4.8d-11)) .or. (.not. (z <= 0.31d0))) then
tmp = (a - t) / y
else
tmp = x / 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.8e-11) || !(z <= 0.31)) {
tmp = (a - t) / y;
} else {
tmp = x / 1.0;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.8e-11) or not (z <= 0.31): tmp = (a - t) / y else: tmp = x / 1.0 return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.8e-11) || !(z <= 0.31)) tmp = Float64(Float64(a - t) / y); else tmp = Float64(x / 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.8e-11) || ~((z <= 0.31))) tmp = (a - t) / y; else tmp = x / 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.8e-11], N[Not[LessEqual[z, 0.31]], $MachinePrecision]], N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision], N[(x / 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-11} \lor \neg \left(z \leq 0.31\right):\\
\;\;\;\;\frac{a - t}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1}\\
\end{array}
\end{array}
if z < -4.8000000000000002e-11 or 0.309999999999999998 < z Initial program 37.2%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6427.3
Applied rewrites27.3%
Taylor expanded in z around inf
Applied rewrites44.6%
Taylor expanded in y around 0
Applied rewrites44.6%
if -4.8000000000000002e-11 < z < 0.309999999999999998Initial program 89.9%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6440.1
Applied rewrites40.1%
Taylor expanded in z around 0
Applied rewrites40.1%
Final simplification42.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.8e-63) (not (<= y 5.3e+82))) (/ x 1.0) (/ (- a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.8e-63) || !(y <= 5.3e+82)) {
tmp = x / 1.0;
} else {
tmp = -a / b;
}
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) :: tmp
if ((y <= (-6.8d-63)) .or. (.not. (y <= 5.3d+82))) then
tmp = x / 1.0d0
else
tmp = -a / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.8e-63) || !(y <= 5.3e+82)) {
tmp = x / 1.0;
} else {
tmp = -a / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.8e-63) or not (y <= 5.3e+82): tmp = x / 1.0 else: tmp = -a / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.8e-63) || !(y <= 5.3e+82)) tmp = Float64(x / 1.0); else tmp = Float64(Float64(-a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.8e-63) || ~((y <= 5.3e+82))) tmp = x / 1.0; else tmp = -a / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.8e-63], N[Not[LessEqual[y, 5.3e+82]], $MachinePrecision]], N[(x / 1.0), $MachinePrecision], N[((-a) / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-63} \lor \neg \left(y \leq 5.3 \cdot 10^{+82}\right):\\
\;\;\;\;\frac{x}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if y < -6.79999999999999997e-63 or 5.29999999999999977e82 < y Initial program 50.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6450.3
Applied rewrites50.3%
Taylor expanded in z around 0
Applied rewrites33.2%
if -6.79999999999999997e-63 < y < 5.29999999999999977e82Initial program 75.3%
Taylor expanded in a around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6440.4
Applied rewrites40.4%
Taylor expanded in y around 0
Applied rewrites35.1%
Final simplification34.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8e-8) (not (<= z 2.75e+34))) (/ a y) (fma (fma x z x) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8e-8) || !(z <= 2.75e+34)) {
tmp = a / y;
} else {
tmp = fma(fma(x, z, x), z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8e-8) || !(z <= 2.75e+34)) tmp = Float64(a / y); else tmp = fma(fma(x, z, x), z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8e-8], N[Not[LessEqual[z, 2.75e+34]], $MachinePrecision]], N[(a / y), $MachinePrecision], N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-8} \lor \neg \left(z \leq 2.75 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{a}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)\\
\end{array}
\end{array}
if z < -8.0000000000000002e-8 or 2.7499999999999998e34 < z Initial program 34.9%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6425.9
Applied rewrites25.9%
Taylor expanded in z around inf
Applied rewrites44.3%
Taylor expanded in t around 0
Applied rewrites23.8%
if -8.0000000000000002e-8 < z < 2.7499999999999998e34Initial program 88.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
Applied rewrites38.4%
Final simplification31.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8e-8) (not (<= z 2.75e+34))) (/ a y) (* (+ 1.0 z) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8e-8) || !(z <= 2.75e+34)) {
tmp = a / y;
} else {
tmp = (1.0 + z) * x;
}
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) :: tmp
if ((z <= (-8d-8)) .or. (.not. (z <= 2.75d+34))) then
tmp = a / y
else
tmp = (1.0d0 + z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8e-8) || !(z <= 2.75e+34)) {
tmp = a / y;
} else {
tmp = (1.0 + z) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8e-8) or not (z <= 2.75e+34): tmp = a / y else: tmp = (1.0 + z) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8e-8) || !(z <= 2.75e+34)) tmp = Float64(a / y); else tmp = Float64(Float64(1.0 + z) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8e-8) || ~((z <= 2.75e+34))) tmp = a / y; else tmp = (1.0 + z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8e-8], N[Not[LessEqual[z, 2.75e+34]], $MachinePrecision]], N[(a / y), $MachinePrecision], N[(N[(1.0 + z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-8} \lor \neg \left(z \leq 2.75 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{a}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + z\right) \cdot x\\
\end{array}
\end{array}
if z < -8.0000000000000002e-8 or 2.7499999999999998e34 < z Initial program 34.9%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6425.9
Applied rewrites25.9%
Taylor expanded in z around inf
Applied rewrites44.3%
Taylor expanded in t around 0
Applied rewrites23.8%
if -8.0000000000000002e-8 < z < 2.7499999999999998e34Initial program 88.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
Applied rewrites38.3%
Applied rewrites38.3%
Final simplification31.4%
(FPCore (x y z t a b) :precision binary64 (* (+ 1.0 z) x))
double code(double x, double y, double z, double t, double a, double b) {
return (1.0 + z) * 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 + z) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (1.0 + z) * x;
}
def code(x, y, z, t, a, b): return (1.0 + z) * x
function code(x, y, z, t, a, b) return Float64(Float64(1.0 + z) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (1.0 + z) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(1.0 + z), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + z\right) \cdot x
\end{array}
Initial program 63.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6430.0
Applied rewrites30.0%
Taylor expanded in z around 0
Applied rewrites21.8%
Applied rewrites21.8%
(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 63.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6430.0
Applied rewrites30.0%
Taylor expanded in z around 0
Applied rewrites21.8%
(FPCore (x y z t a b) :precision binary64 (* z x))
double code(double x, double y, double z, double t, double a, double b) {
return z * 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 = z * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z * x;
}
def code(x, y, z, t, a, b): return z * x
function code(x, y, z, t, a, b) return Float64(z * x) end
function tmp = code(x, y, z, t, a, b) tmp = z * x; end
code[x_, y_, z_, t_, a_, b_] := N[(z * x), $MachinePrecision]
\begin{array}{l}
\\
z \cdot x
\end{array}
Initial program 63.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6430.0
Applied rewrites30.0%
Taylor expanded in z around 0
Applied rewrites21.8%
Taylor expanded in z around inf
Applied rewrites4.2%
(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 2024324
(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)))))