
(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 12 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 (fma z (- b y) y))
(t_2 (fma z (/ (- t a) t_1) (* x (/ y t_1))))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) (+ y (* z (- b y))))))
(if (<= t_4 -1e+257)
t_2
(if (<= t_4 2e+258)
(/
1.0
(fma
(- b y)
(/ 1.0 (/ (fma y x t_3) z))
(/ y (fma z (- t a) (* x y)))))
(if (<= t_4 INFINITY) t_2 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (b - y), y);
double t_2 = fma(z, ((t - a) / t_1), (x * (y / t_1)));
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / (y + (z * (b - y)));
double tmp;
if (t_4 <= -1e+257) {
tmp = t_2;
} else if (t_4 <= 2e+258) {
tmp = 1.0 / fma((b - y), (1.0 / (fma(y, x, t_3) / z)), (y / fma(z, (t - a), (x * y))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(b - y), y) t_2 = fma(z, Float64(Float64(t - a) / t_1), Float64(x * Float64(y / t_1))) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_4 <= -1e+257) tmp = t_2; elseif (t_4 <= 2e+258) tmp = Float64(1.0 / fma(Float64(b - y), Float64(1.0 / Float64(fma(y, x, t_3) / z)), Float64(y / fma(z, Float64(t - a), Float64(x * y))))); elseif (t_4 <= Inf) tmp = t_2; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1e+257], t$95$2, If[LessEqual[t$95$4, 2e+258], N[(1.0 / N[(N[(b - y), $MachinePrecision] * N[(1.0 / N[(N[(y * x + t$95$3), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * N[(t - a), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$2, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, b - y, y\right)\\
t_2 := \mathsf{fma}\left(z, \frac{t - a}{t\_1}, x \cdot \frac{y}{t\_1}\right)\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t\_3}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{+257}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+258}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b - y, \frac{1}{\frac{\mathsf{fma}\left(y, x, t\_3\right)}{z}}, \frac{y}{\mathsf{fma}\left(z, t - a, x \cdot y\right)}\right)}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000003e257 or 2.00000000000000011e258 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 38.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6499.9
Simplified99.9%
if -1.00000000000000003e257 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000011e258Initial program 89.4%
div-invN/A
flip-+N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
Applied egg-rr89.0%
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
div-invN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr98.2%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f6498.4
Applied egg-rr98.4%
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
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6477.2
Simplified77.2%
Final simplification95.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma z (- b y) y))
(t_4 (fma z (/ (- t a) t_3) (* x (/ y t_3)))))
(if (<= t_2 -1e+257)
t_4
(if (<= t_2 -5e-305)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 2e+258) t_2 (if (<= t_2 INFINITY) t_4 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma(z, (b - y), y);
double t_4 = fma(z, ((t - a) / t_3), (x * (y / t_3)));
double tmp;
if (t_2 <= -1e+257) {
tmp = t_4;
} else if (t_2 <= -5e-305) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 2e+258) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(z, Float64(b - y), y) t_4 = fma(z, Float64(Float64(t - a) / t_3), Float64(x * Float64(y / t_3))) tmp = 0.0 if (t_2 <= -1e+257) tmp = t_4; elseif (t_2 <= -5e-305) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 2e+258) tmp = t_2; elseif (t_2 <= 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(x * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+257], t$95$4, If[LessEqual[t$95$2, -5e-305], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 2e+258], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(z, b - y, y\right)\\
t_4 := \mathsf{fma}\left(z, \frac{t - a}{t\_3}, x \cdot \frac{y}{t\_3}\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+257}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-305}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+258}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \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)))) < -1.00000000000000003e257 or 2.00000000000000011e258 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 38.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6499.9
Simplified99.9%
if -1.00000000000000003e257 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.99999999999999985e-305 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000011e258Initial program 99.1%
if -4.99999999999999985e-305 < (/.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 9.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6479.2
Simplified79.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- t a) (* x y)))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma z (- b y) y))
(t_4 (fma z (/ (- t a) t_3) (* x (/ y t_3)))))
(if (<= t_2 -1e+257)
t_4
(if (<= t_2 2e+258)
(/ 1.0 (fma (- b y) (/ z t_1) (/ y t_1)))
(if (<= t_2 INFINITY) t_4 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (t - a), (x * y));
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma(z, (b - y), y);
double t_4 = fma(z, ((t - a) / t_3), (x * (y / t_3)));
double tmp;
if (t_2 <= -1e+257) {
tmp = t_4;
} else if (t_2 <= 2e+258) {
tmp = 1.0 / fma((b - y), (z / t_1), (y / t_1));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(t - a), Float64(x * y)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(z, Float64(b - y), y) t_4 = fma(z, Float64(Float64(t - a) / t_3), Float64(x * Float64(y / t_3))) tmp = 0.0 if (t_2 <= -1e+257) tmp = t_4; elseif (t_2 <= 2e+258) tmp = Float64(1.0 / fma(Float64(b - y), Float64(z / t_1), Float64(y / t_1))); elseif (t_2 <= Inf) tmp = t_4; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(x * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+257], t$95$4, If[LessEqual[t$95$2, 2e+258], N[(1.0 / N[(N[(b - y), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$4, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, t - a, x \cdot y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(z, b - y, y\right)\\
t_4 := \mathsf{fma}\left(z, \frac{t - a}{t\_3}, x \cdot \frac{y}{t\_3}\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+257}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+258}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b - y, \frac{z}{t\_1}, \frac{y}{t\_1}\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000003e257 or 2.00000000000000011e258 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 38.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6499.9
Simplified99.9%
if -1.00000000000000003e257 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000011e258Initial program 89.4%
div-invN/A
flip-+N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
Applied egg-rr89.0%
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
div-invN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr98.2%
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
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6477.2
Simplified77.2%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -5.2e+18)
t_1
(if (<= z 465000.0)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b 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 <= -5.2e+18) {
tmp = t_1;
} else if (z <= 465000.0) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - 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 <= (-5.2d+18)) then
tmp = t_1
else if (z <= 465000.0d0) then
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - 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 <= -5.2e+18) {
tmp = t_1;
} else if (z <= 465000.0) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - 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 <= -5.2e+18: tmp = t_1 elif z <= 465000.0: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - 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 <= -5.2e+18) tmp = t_1; elseif (z <= 465000.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - 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 <= -5.2e+18) tmp = t_1; elseif (z <= 465000.0) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - 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, -5.2e+18], t$95$1, If[LessEqual[z, 465000.0], 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], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 465000:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.2e18 or 465000 < z Initial program 38.4%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6484.6
Simplified84.6%
if -5.2e18 < z < 465000Initial program 86.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.65e-39)
t_1
(if (<= z 2.6e-42) (* x (/ y (fma z (- b 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 <= -1.65e-39) {
tmp = t_1;
} else if (z <= 2.6e-42) {
tmp = x * (y / fma(z, (b - 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 <= -1.65e-39) tmp = t_1; elseif (z <= 2.6e-42) tmp = Float64(x * Float64(y / fma(z, Float64(b - 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, -1.65e-39], t$95$1, If[LessEqual[z, 2.6e-42], N[(x * N[(y / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-42}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.64999999999999992e-39 or 2.6e-42 < z Initial program 48.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6481.0
Simplified81.0%
if -1.64999999999999992e-39 < z < 2.6e-42Initial program 84.5%
Taylor expanded in x around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6464.3
Simplified64.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) b)))
(if (<= z -3.6e+137)
(/ t (- b y))
(if (<= z -4.1e-36) t_1 (if (<= z 2.05e-55) (/ x (- 1.0 z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -3.6e+137) {
tmp = t / (b - y);
} else if (z <= -4.1e-36) {
tmp = t_1;
} else if (z <= 2.05e-55) {
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 - a) / b
if (z <= (-3.6d+137)) then
tmp = t / (b - y)
else if (z <= (-4.1d-36)) then
tmp = t_1
else if (z <= 2.05d-55) 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 - a) / b;
double tmp;
if (z <= -3.6e+137) {
tmp = t / (b - y);
} else if (z <= -4.1e-36) {
tmp = t_1;
} else if (z <= 2.05e-55) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b tmp = 0 if z <= -3.6e+137: tmp = t / (b - y) elif z <= -4.1e-36: tmp = t_1 elif z <= 2.05e-55: tmp = x / (1.0 - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) tmp = 0.0 if (z <= -3.6e+137) tmp = Float64(t / Float64(b - y)); elseif (z <= -4.1e-36) tmp = t_1; elseif (z <= 2.05e-55) 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 - a) / b; tmp = 0.0; if (z <= -3.6e+137) tmp = t / (b - y); elseif (z <= -4.1e-36) tmp = t_1; elseif (z <= 2.05e-55) 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[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[z, -3.6e+137], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.1e-36], t$95$1, If[LessEqual[z, 2.05e-55], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+137}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.6e137Initial program 26.2%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6421.4
Simplified21.4%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6466.1
Simplified66.1%
if -3.6e137 < z < -4.10000000000000013e-36 or 2.0499999999999999e-55 < z Initial program 57.5%
Taylor expanded in y around 0
/-lowering-/.f64N/A
--lowering--.f6455.6
Simplified55.6%
if -4.10000000000000013e-36 < z < 2.0499999999999999e-55Initial program 84.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6453.4
Simplified53.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.4e-38) (/ t b) (if (<= z 1.02e-39) x (if (<= z 7.6e+77) (- (/ a b)) (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.4e-38) {
tmp = t / b;
} else if (z <= 1.02e-39) {
tmp = x;
} else if (z <= 7.6e+77) {
tmp = -(a / b);
} 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.4d-38)) then
tmp = t / b
else if (z <= 1.02d-39) then
tmp = x
else if (z <= 7.6d+77) then
tmp = -(a / b)
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.4e-38) {
tmp = t / b;
} else if (z <= 1.02e-39) {
tmp = x;
} else if (z <= 7.6e+77) {
tmp = -(a / b);
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.4e-38: tmp = t / b elif z <= 1.02e-39: tmp = x elif z <= 7.6e+77: tmp = -(a / b) else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.4e-38) tmp = Float64(t / b); elseif (z <= 1.02e-39) tmp = x; elseif (z <= 7.6e+77) tmp = Float64(-Float64(a / b)); 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.4e-38) tmp = t / b; elseif (z <= 1.02e-39) tmp = x; elseif (z <= 7.6e+77) tmp = -(a / b); else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.4e-38], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.02e-39], x, If[LessEqual[z, 7.6e+77], (-N[(a / b), $MachinePrecision]), N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-38}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+77}:\\
\;\;\;\;-\frac{a}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -1.4e-38 or 7.6000000000000002e77 < z Initial program 41.1%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6425.4
Simplified25.4%
Taylor expanded in b around inf
/-lowering-/.f6437.5
Simplified37.5%
if -1.4e-38 < z < 1.02000000000000007e-39Initial program 84.7%
Taylor expanded in z around 0
Simplified52.6%
if 1.02000000000000007e-39 < z < 7.6000000000000002e77Initial program 82.7%
Taylor expanded in b around inf
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6449.4
Simplified49.4%
Taylor expanded in a around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6441.9
Simplified41.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -1.35e-39) t_1 (if (<= z 9.8e-46) (/ x (- 1.0 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 <= -1.35e-39) {
tmp = t_1;
} else if (z <= 9.8e-46) {
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 - a) / (b - y)
if (z <= (-1.35d-39)) then
tmp = t_1
else if (z <= 9.8d-46) 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 - a) / (b - y);
double tmp;
if (z <= -1.35e-39) {
tmp = t_1;
} else if (z <= 9.8e-46) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -1.35e-39: tmp = t_1 elif z <= 9.8e-46: tmp = x / (1.0 - 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 <= -1.35e-39) tmp = t_1; elseif (z <= 9.8e-46) 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 - a) / (b - y); tmp = 0.0; if (z <= -1.35e-39) tmp = t_1; elseif (z <= 9.8e-46) 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[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e-39], t$95$1, If[LessEqual[z, 9.8e-46], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35e-39 or 9.8000000000000002e-46 < z Initial program 48.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6481.0
Simplified81.0%
if -1.35e-39 < z < 9.8000000000000002e-46Initial program 84.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6452.9
Simplified52.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -3.65e-37) t_1 (if (<= z 1.02e-44) (/ 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.65e-37) {
tmp = t_1;
} else if (z <= 1.02e-44) {
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.65d-37)) then
tmp = t_1
else if (z <= 1.02d-44) 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.65e-37) {
tmp = t_1;
} else if (z <= 1.02e-44) {
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.65e-37: tmp = t_1 elif z <= 1.02e-44: 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.65e-37) tmp = t_1; elseif (z <= 1.02e-44) 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.65e-37) tmp = t_1; elseif (z <= 1.02e-44) 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.65e-37], t$95$1, If[LessEqual[z, 1.02e-44], 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.65 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.6499999999999998e-37 or 1.0199999999999999e-44 < z Initial program 48.6%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6426.9
Simplified26.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6450.0
Simplified50.0%
if -3.6499999999999998e-37 < z < 1.0199999999999999e-44Initial program 84.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6452.9
Simplified52.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -6.8e-38) t_1 (if (<= z 7.5e-44) 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 <= -6.8e-38) {
tmp = t_1;
} else if (z <= 7.5e-44) {
tmp = 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 / (b - y)
if (z <= (-6.8d-38)) then
tmp = t_1
else if (z <= 7.5d-44) then
tmp = 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 / (b - y);
double tmp;
if (z <= -6.8e-38) {
tmp = t_1;
} else if (z <= 7.5e-44) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -6.8e-38: tmp = t_1 elif z <= 7.5e-44: tmp = 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 <= -6.8e-38) tmp = t_1; elseif (z <= 7.5e-44) tmp = x; 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 <= -6.8e-38) tmp = t_1; elseif (z <= 7.5e-44) tmp = x; 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, -6.8e-38], t$95$1, If[LessEqual[z, 7.5e-44], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.8000000000000004e-38 or 7.50000000000000008e-44 < z Initial program 48.6%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6426.9
Simplified26.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6450.0
Simplified50.0%
if -6.8000000000000004e-38 < z < 7.50000000000000008e-44Initial program 84.5%
Taylor expanded in z around 0
Simplified52.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8.8e-38) (/ t b) (if (<= z 7e-41) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.8e-38) {
tmp = t / b;
} else if (z <= 7e-41) {
tmp = 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 <= (-8.8d-38)) then
tmp = t / b
else if (z <= 7d-41) then
tmp = 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 <= -8.8e-38) {
tmp = t / b;
} else if (z <= 7e-41) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8.8e-38: tmp = t / b elif z <= 7e-41: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8.8e-38) tmp = Float64(t / b); elseif (z <= 7e-41) tmp = 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 <= -8.8e-38) tmp = t / b; elseif (z <= 7e-41) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.8e-38], N[(t / b), $MachinePrecision], If[LessEqual[z, 7e-41], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-41}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -8.80000000000000029e-38 or 6.9999999999999999e-41 < z Initial program 48.6%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6426.9
Simplified26.9%
Taylor expanded in b around inf
/-lowering-/.f6434.3
Simplified34.3%
if -8.80000000000000029e-38 < z < 6.9999999999999999e-41Initial program 84.5%
Taylor expanded in z around 0
Simplified52.9%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return 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 = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 65.6%
Taylor expanded in z around 0
Simplified27.1%
(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 2024198
(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)))))