
(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 16 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 (<= z -8.2e+99)
t_1
(if (<= z 2e+48)
(/ (+ (* y x) (* (- t a) z)) (+ (* (- b y) z) y))
(-
t_1
(/
(fma (- y) (/ x (- b y)) (* (/ y (pow (- b y) 2.0)) (- t a)))
z))))))
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 <= -8.2e+99) {
tmp = t_1;
} else if (z <= 2e+48) {
tmp = ((y * x) + ((t - a) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1 - (fma(-y, (x / (b - y)), ((y / pow((b - y), 2.0)) * (t - a))) / z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8.2e+99) tmp = t_1; elseif (z <= 2e+48) tmp = Float64(Float64(Float64(y * x) + Float64(Float64(t - a) * z)) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = Float64(t_1 - Float64(fma(Float64(-y), Float64(x / Float64(b - y)), Float64(Float64(y / (Float64(b - y) ^ 2.0)) * Float64(t - a))) / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+99], t$95$1, If[LessEqual[z, 2e+48], N[(N[(N[(y * x), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(N[((-y) * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+48}:\\
\;\;\;\;\frac{y \cdot x + \left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{\mathsf{fma}\left(-y, \frac{x}{b - y}, \frac{y}{{\left(b - y\right)}^{2}} \cdot \left(t - a\right)\right)}{z}\\
\end{array}
\end{array}
if z < -8.19999999999999959e99Initial program 28.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6493.3
Applied rewrites93.3%
if -8.19999999999999959e99 < z < 2.00000000000000009e48Initial program 86.5%
if 2.00000000000000009e48 < z Initial program 35.0%
Taylor expanded in z around inf
Applied rewrites98.0%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (fma (- a) z (* y x)) t_1))
(t_3 (/ (- t a) (- b y)))
(t_4 (/ (fma t z (* y x)) t_1)))
(if (<= z -5.6e+59)
t_3
(if (<= z -2.45e-86)
t_2
(if (<= z -2.5e-290)
t_4
(if (<= z 3.8e-202)
(* (/ y t_1) x)
(if (<= z 1.7e-142) t_2 (if (<= z 1.15e+14) t_4 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 = fma(-a, z, (y * x)) / t_1;
double t_3 = (t - a) / (b - y);
double t_4 = fma(t, z, (y * x)) / t_1;
double tmp;
if (z <= -5.6e+59) {
tmp = t_3;
} else if (z <= -2.45e-86) {
tmp = t_2;
} else if (z <= -2.5e-290) {
tmp = t_4;
} else if (z <= 3.8e-202) {
tmp = (y / t_1) * x;
} else if (z <= 1.7e-142) {
tmp = t_2;
} else if (z <= 1.15e+14) {
tmp = t_4;
} 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(fma(Float64(-a), z, Float64(y * x)) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) t_4 = Float64(fma(t, z, Float64(y * x)) / t_1) tmp = 0.0 if (z <= -5.6e+59) tmp = t_3; elseif (z <= -2.45e-86) tmp = t_2; elseif (z <= -2.5e-290) tmp = t_4; elseif (z <= 3.8e-202) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 1.7e-142) tmp = t_2; elseif (z <= 1.15e+14) tmp = t_4; 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[((-a) * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[z, -5.6e+59], t$95$3, If[LessEqual[z, -2.45e-86], t$95$2, If[LessEqual[z, -2.5e-290], t$95$4, If[LessEqual[z, 3.8e-202], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.7e-142], t$95$2, If[LessEqual[z, 1.15e+14], t$95$4, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{\mathsf{fma}\left(-a, z, y \cdot x\right)}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
t_4 := \frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+59}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-86}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-290}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-202}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+14}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -5.5999999999999996e59 or 1.15e14 < z Initial program 42.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6489.1
Applied rewrites89.1%
if -5.5999999999999996e59 < z < -2.44999999999999986e-86 or 3.80000000000000014e-202 < z < 1.70000000000000014e-142Initial program 90.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6474.5
Applied rewrites74.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f6474.5
Applied rewrites74.5%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6477.1
Applied rewrites77.1%
if -2.44999999999999986e-86 < z < -2.5e-290 or 1.70000000000000014e-142 < z < 1.15e14Initial program 90.1%
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--.f6473.6
Applied rewrites73.6%
if -2.5e-290 < z < 3.80000000000000014e-202Initial program 69.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--.f6484.4
Applied rewrites84.4%
(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 -1.35e-8)
t_3
(if (<= z -3.5e-131)
t_2
(if (<= z 1.1e-191) (* (/ y t_1) x) (if (<= z 4e-28) 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 <= -1.35e-8) {
tmp = t_3;
} else if (z <= -3.5e-131) {
tmp = t_2;
} else if (z <= 1.1e-191) {
tmp = (y / t_1) * x;
} else if (z <= 4e-28) {
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 <= -1.35e-8) tmp = t_3; elseif (z <= -3.5e-131) tmp = t_2; elseif (z <= 1.1e-191) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 4e-28) 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, -1.35e-8], t$95$3, If[LessEqual[z, -3.5e-131], t$95$2, If[LessEqual[z, 1.1e-191], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 4e-28], 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 -1.35 \cdot 10^{-8}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-191}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-28}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.35000000000000001e-8 or 3.99999999999999988e-28 < z Initial program 49.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.2
Applied rewrites83.2%
if -1.35000000000000001e-8 < z < -3.5000000000000002e-131 or 1.09999999999999999e-191 < z < 3.99999999999999988e-28Initial program 95.0%
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-/.f6495.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.0
Applied rewrites95.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--.f6465.4
Applied rewrites65.4%
if -3.5000000000000002e-131 < z < 1.09999999999999999e-191Initial program 78.2%
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--.f6472.8
Applied rewrites72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8.2e+99)
t_1
(if (<= z 1.25e+43)
(/ (+ (* y x) (* (- t a) z)) (+ (* (- b y) z) y))
t_1))))
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 <= -8.2e+99) {
tmp = t_1;
} else if (z <= 1.25e+43) {
tmp = ((y * x) + ((t - a) * z)) / (((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 = (t - a) / (b - y)
if (z <= (-8.2d+99)) then
tmp = t_1
else if (z <= 1.25d+43) then
tmp = ((y * x) + ((t - a) * z)) / (((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 = (t - a) / (b - y);
double tmp;
if (z <= -8.2e+99) {
tmp = t_1;
} else if (z <= 1.25e+43) {
tmp = ((y * x) + ((t - a) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -8.2e+99: tmp = t_1 elif z <= 1.25e+43: tmp = ((y * x) + ((t - a) * z)) / (((b - y) * z) + y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8.2e+99) tmp = t_1; elseif (z <= 1.25e+43) tmp = Float64(Float64(Float64(y * x) + Float64(Float64(t - a) * z)) / 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 = (t - a) / (b - y); tmp = 0.0; if (z <= -8.2e+99) tmp = t_1; elseif (z <= 1.25e+43) tmp = ((y * x) + ((t - a) * z)) / (((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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+99], t$95$1, If[LessEqual[z, 1.25e+43], N[(N[(N[(y * x), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] * z), $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{t - a}{b - y}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+43}:\\
\;\;\;\;\frac{y \cdot x + \left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.19999999999999959e99 or 1.2500000000000001e43 < z Initial program 32.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.5
Applied rewrites92.5%
if -8.19999999999999959e99 < z < 1.2500000000000001e43Initial program 86.4%
Final simplification88.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -7.8e-39)
t_1
(if (<= z 1.15e+14) (/ (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 = (t - a) / (b - y);
double tmp;
if (z <= -7.8e-39) {
tmp = t_1;
} else if (z <= 1.15e+14) {
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(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -7.8e-39) tmp = t_1; elseif (z <= 1.15e+14) 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e-39], t$95$1, If[LessEqual[z, 1.15e+14], 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{t - a}{b - y}\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+14}:\\
\;\;\;\;\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 < -7.80000000000000059e-39 or 1.15e14 < z Initial program 48.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.2
Applied rewrites84.2%
if -7.80000000000000059e-39 < z < 1.15e14Initial program 86.3%
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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.7e-144)
t_1
(if (<= z 3.1e-196)
(fma (fma x z x) z x)
(if (<= z 1.28e-134) (* (/ -1.0 y) (* a z)) t_1)))))
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 <= -2.7e-144) {
tmp = t_1;
} else if (z <= 3.1e-196) {
tmp = fma(fma(x, z, x), z, x);
} else if (z <= 1.28e-134) {
tmp = (-1.0 / y) * (a * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.7e-144) tmp = t_1; elseif (z <= 3.1e-196) tmp = fma(fma(x, z, x), z, x); elseif (z <= 1.28e-134) tmp = Float64(Float64(-1.0 / y) * Float64(a * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e-144], t$95$1, If[LessEqual[z, 3.1e-196], N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 1.28e-134], N[(N[(-1.0 / y), $MachinePrecision] * N[(a * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{-144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-196}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-134}:\\
\;\;\;\;\frac{-1}{y} \cdot \left(a \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.69999999999999975e-144 or 1.28e-134 < z Initial program 62.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.5
Applied rewrites69.5%
if -2.69999999999999975e-144 < z < 3.09999999999999993e-196Initial program 77.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6464.4
Applied rewrites64.4%
Taylor expanded in z around 0
Applied rewrites64.4%
if 3.09999999999999993e-196 < z < 1.28e-134Initial program 99.7%
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-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
lower-/.f6463.3
Applied rewrites63.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6443.9
Applied rewrites43.9%
Final simplification66.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.3e-86)
t_1
(if (<= z 1e-28) (* (/ y (fma (- b y) z y)) x) t_1))))
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 <= -1.3e-86) {
tmp = t_1;
} else if (z <= 1e-28) {
tmp = (y / fma((b - y), z, y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.3e-86) tmp = t_1; elseif (z <= 1e-28) tmp = Float64(Float64(y / fma(Float64(b - y), z, y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e-86], t$95$1, If[LessEqual[z, 1e-28], N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-28}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3000000000000001e-86 or 9.99999999999999971e-29 < z Initial program 53.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.1
Applied rewrites80.1%
if -1.3000000000000001e-86 < z < 9.99999999999999971e-29Initial program 85.2%
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--.f6458.8
Applied rewrites58.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.85e-91)
t_1
(if (<= z 1.45e-156) (* (/ x (fma z (- b y) y)) y) t_1))))
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 <= -4.85e-91) {
tmp = t_1;
} else if (z <= 1.45e-156) {
tmp = (x / fma(z, (b - y), y)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.85e-91) tmp = t_1; elseif (z <= 1.45e-156) tmp = Float64(Float64(x / fma(z, Float64(b - y), y)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.85e-91], t$95$1, If[LessEqual[z, 1.45e-156], N[(N[(x / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.85 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-156}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(z, b - y, y\right)} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.84999999999999975e-91 or 1.4500000000000001e-156 < z Initial program 60.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.4
Applied rewrites72.4%
if -4.84999999999999975e-91 < z < 1.4500000000000001e-156Initial program 82.5%
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--.f6464.8
Applied rewrites64.8%
Applied rewrites52.5%
Final simplification65.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -8.5e+85)
t_1
(if (<= y 3e-179) (/ t (- b y)) (if (<= y 1.15e-34) (/ (- 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 <= -8.5e+85) {
tmp = t_1;
} else if (y <= 3e-179) {
tmp = t / (b - y);
} else if (y <= 1.15e-34) {
tmp = -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 <= (-8.5d+85)) then
tmp = t_1
else if (y <= 3d-179) then
tmp = t / (b - y)
else if (y <= 1.15d-34) then
tmp = -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 <= -8.5e+85) {
tmp = t_1;
} else if (y <= 3e-179) {
tmp = t / (b - y);
} else if (y <= 1.15e-34) {
tmp = -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 <= -8.5e+85: tmp = t_1 elif y <= 3e-179: tmp = t / (b - y) elif y <= 1.15e-34: tmp = -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 <= -8.5e+85) tmp = t_1; elseif (y <= 3e-179) tmp = Float64(t / Float64(b - y)); elseif (y <= 1.15e-34) tmp = Float64(Float64(-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 <= -8.5e+85) tmp = t_1; elseif (y <= 3e-179) tmp = t / (b - y); elseif (y <= 1.15e-34) tmp = -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, -8.5e+85], t$95$1, If[LessEqual[y, 3e-179], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-34], N[((-a) / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-179}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-34}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.4999999999999994e85 or 1.15000000000000006e-34 < y Initial program 50.7%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6460.5
Applied rewrites60.5%
if -8.4999999999999994e85 < y < 3.00000000000000006e-179Initial program 82.0%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6439.2
Applied rewrites39.2%
Taylor expanded in z around inf
Applied rewrites39.0%
if 3.00000000000000006e-179 < y < 1.15000000000000006e-34Initial program 70.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6462.0
Applied rewrites62.0%
Taylor expanded in t around 0
Applied rewrites52.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -2.7e-144) t_1 (if (<= z 4.5e-134) (* 1.0 x) t_1))))
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 <= -2.7e-144) {
tmp = t_1;
} else if (z <= 4.5e-134) {
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 = (t - a) / (b - y)
if (z <= (-2.7d-144)) then
tmp = t_1
else if (z <= 4.5d-134) 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 = (t - a) / (b - y);
double tmp;
if (z <= -2.7e-144) {
tmp = t_1;
} else if (z <= 4.5e-134) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -2.7e-144: tmp = t_1 elif z <= 4.5e-134: tmp = 1.0 * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.7e-144) tmp = t_1; elseif (z <= 4.5e-134) 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 = (t - a) / (b - y); tmp = 0.0; if (z <= -2.7e-144) tmp = t_1; elseif (z <= 4.5e-134) 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e-144], t$95$1, If[LessEqual[z, 4.5e-134], N[(1.0 * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{-144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-134}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.69999999999999975e-144 or 4.5000000000000005e-134 < z Initial program 62.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.5
Applied rewrites69.5%
if -2.69999999999999975e-144 < z < 4.5000000000000005e-134Initial program 81.4%
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--.f6467.2
Applied rewrites67.2%
Taylor expanded in z around 0
Applied rewrites55.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -7.2e-23) t_1 (if (<= y 1.06e+43) (/ (- 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 <= -7.2e-23) {
tmp = t_1;
} else if (y <= 1.06e+43) {
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 <= (-7.2d-23)) then
tmp = t_1
else if (y <= 1.06d+43) 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 <= -7.2e-23) {
tmp = t_1;
} else if (y <= 1.06e+43) {
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 <= -7.2e-23: tmp = t_1 elif y <= 1.06e+43: 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 <= -7.2e-23) tmp = t_1; elseif (y <= 1.06e+43) 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 <= -7.2e-23) tmp = t_1; elseif (y <= 1.06e+43) 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, -7.2e-23], t$95$1, If[LessEqual[y, 1.06e+43], 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 -7.2 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+43}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.1999999999999996e-23 or 1.06000000000000006e43 < y Initial program 52.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6458.1
Applied rewrites58.1%
if -7.1999999999999996e-23 < y < 1.06000000000000006e43Initial program 79.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6455.0
Applied rewrites55.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -1.15e-56) t_1 (if (<= z 6.6e-6) (fma (fma x z x) z x) 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 <= -1.15e-56) {
tmp = t_1;
} else if (z <= 6.6e-6) {
tmp = fma(fma(x, z, x), z, x);
} 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 <= -1.15e-56) tmp = t_1; elseif (z <= 6.6e-6) tmp = fma(fma(x, z, x), z, x); 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, -1.15e-56], t$95$1, If[LessEqual[z, 6.6e-6], N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15000000000000001e-56 or 6.60000000000000034e-6 < z Initial program 51.1%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6430.9
Applied rewrites30.9%
Taylor expanded in z around inf
Applied rewrites45.9%
if -1.15000000000000001e-56 < z < 6.60000000000000034e-6Initial program 85.6%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6445.2
Applied rewrites45.2%
Taylor expanded in z around 0
Applied rewrites45.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.15e-56) (/ t b) (if (<= z 2.6e-28) (* 1.0 x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.15e-56) {
tmp = t / b;
} else if (z <= 2.6e-28) {
tmp = 1.0 * x;
} else {
tmp = t / 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 (z <= (-1.15d-56)) then
tmp = t / b
else if (z <= 2.6d-28) then
tmp = 1.0d0 * x
else
tmp = t / 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 (z <= -1.15e-56) {
tmp = t / b;
} else if (z <= 2.6e-28) {
tmp = 1.0 * x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.15e-56: tmp = t / b elif z <= 2.6e-28: tmp = 1.0 * x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.15e-56) tmp = Float64(t / b); elseif (z <= 2.6e-28) tmp = Float64(1.0 * x); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.15e-56) tmp = t / b; elseif (z <= 2.6e-28) tmp = 1.0 * x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.15e-56], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.6e-28], N[(1.0 * x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-56}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-28}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -1.15000000000000001e-56 or 2.6e-28 < z Initial program 51.9%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6431.2
Applied rewrites31.2%
Taylor expanded in y around 0
Applied rewrites31.8%
if -1.15000000000000001e-56 < z < 2.6e-28Initial program 85.4%
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--.f6457.6
Applied rewrites57.6%
Taylor expanded in z around 0
Applied rewrites45.1%
(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 68.1%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in z around 0
Applied rewrites24.6%
(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 68.1%
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--.f6437.8
Applied rewrites37.8%
Taylor expanded in z around 0
Applied rewrites24.1%
(FPCore (x y z t a b) :precision binary64 (* x z))
double code(double x, double y, double z, double t, double a, double b) {
return x * 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 = x * z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * z;
}
def code(x, y, z, t, a, b): return x * z
function code(x, y, z, t, a, b) return Float64(x * z) end
function tmp = code(x, y, z, t, a, b) tmp = x * z; end
code[x_, y_, z_, t_, a_, b_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 68.1%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in z around 0
Applied rewrites24.6%
Taylor expanded in z around inf
Applied rewrites3.5%
Final simplification3.5%
(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 2024296
(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)))))