
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (+ (/ (+ (* (- 1.0 t) (* z 2.0)) 2.0) (* t z)) (/ x y)) INFINITY) (+ (/ (fma z 2.0 (fma z (* -2.0 t) 2.0)) (* t z)) (/ x y)) (+ -2.0 (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((((((1.0 - t) * (z * 2.0)) + 2.0) / (t * z)) + (x / y)) <= ((double) INFINITY)) {
tmp = (fma(z, 2.0, fma(z, (-2.0 * t), 2.0)) / (t * z)) + (x / y);
} else {
tmp = -2.0 + (x / y);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(1.0 - t) * Float64(z * 2.0)) + 2.0) / Float64(t * z)) + Float64(x / y)) <= Inf) tmp = Float64(Float64(fma(z, 2.0, fma(z, Float64(-2.0 * t), 2.0)) / Float64(t * z)) + Float64(x / y)); else tmp = Float64(-2.0 + Float64(x / y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[(N[(N[(1.0 - t), $MachinePrecision] * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(z * 2.0 + N[(z * N[(-2.0 * t), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(1 - t\right) \cdot \left(z \cdot 2\right) + 2}{t \cdot z} + \frac{x}{y} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, 2, \mathsf{fma}\left(z, -2 \cdot t, 2\right)\right)}{t \cdot z} + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{x}{y}\\
\end{array}
\end{array}
if (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-fma.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval99.8
Applied rewrites99.8%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf
Applied rewrites97.6%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ (* (- 1.0 t) (* z 2.0)) 2.0) (* t z)))
(t_2 (+ -2.0 (/ x y))))
(if (<= t_1 -5e+14)
(/ (fma 2.0 z 2.0) (* t z))
(if (<= t_1 5e+28)
t_2
(if (<= t_1 INFINITY) (/ (- (/ 2.0 z) -2.0) t) t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = (((1.0 - t) * (z * 2.0)) + 2.0) / (t * z);
double t_2 = -2.0 + (x / y);
double tmp;
if (t_1 <= -5e+14) {
tmp = fma(2.0, z, 2.0) / (t * z);
} else if (t_1 <= 5e+28) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((2.0 / z) - -2.0) / t;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(Float64(1.0 - t) * Float64(z * 2.0)) + 2.0) / Float64(t * z)) t_2 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (t_1 <= -5e+14) tmp = Float64(fma(2.0, z, 2.0) / Float64(t * z)); elseif (t_1 <= 5e+28) tmp = t_2; elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(2.0 / z) - -2.0) / t); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(1.0 - t), $MachinePrecision] * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+14], N[(N[(2.0 * z + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+28], t$95$2, If[LessEqual[t$95$1, Infinity], N[(N[(N[(2.0 / z), $MachinePrecision] - -2.0), $MachinePrecision] / t), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(1 - t\right) \cdot \left(z \cdot 2\right) + 2}{t \cdot z}\\
t_2 := -2 + \frac{x}{y}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+14}:\\
\;\;\;\;\frac{\mathsf{fma}\left(2, z, 2\right)}{t \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\frac{2}{z} - -2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < -5e14Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6476.2
Applied rewrites76.2%
Taylor expanded in z around 0
Applied rewrites77.3%
if -5e14 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < 4.99999999999999957e28 or +inf.0 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) Initial program 59.6%
Taylor expanded in t around inf
Applied rewrites96.4%
if 4.99999999999999957e28 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < +inf.0Initial program 97.2%
Taylor expanded in t around 0
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6475.8
Applied rewrites75.8%
Final simplification84.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (fma 2.0 z 2.0) (* t z)))
(t_2 (/ (+ (* (- 1.0 t) (* z 2.0)) 2.0) (* t z)))
(t_3 (+ -2.0 (/ x y))))
(if (<= t_2 -5e+14)
t_1
(if (<= t_2 5e+28) t_3 (if (<= t_2 INFINITY) t_1 t_3)))))
double code(double x, double y, double z, double t) {
double t_1 = fma(2.0, z, 2.0) / (t * z);
double t_2 = (((1.0 - t) * (z * 2.0)) + 2.0) / (t * z);
double t_3 = -2.0 + (x / y);
double tmp;
if (t_2 <= -5e+14) {
tmp = t_1;
} else if (t_2 <= 5e+28) {
tmp = t_3;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(fma(2.0, z, 2.0) / Float64(t * z)) t_2 = Float64(Float64(Float64(Float64(1.0 - t) * Float64(z * 2.0)) + 2.0) / Float64(t * z)) t_3 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (t_2 <= -5e+14) tmp = t_1; elseif (t_2 <= 5e+28) tmp = t_3; elseif (t_2 <= Inf) tmp = t_1; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 * z + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(1.0 - t), $MachinePrecision] * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+14], t$95$1, If[LessEqual[t$95$2, 5e+28], t$95$3, If[LessEqual[t$95$2, Infinity], t$95$1, t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(2, z, 2\right)}{t \cdot z}\\
t_2 := \frac{\left(1 - t\right) \cdot \left(z \cdot 2\right) + 2}{t \cdot z}\\
t_3 := -2 + \frac{x}{y}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < -5e14 or 4.99999999999999957e28 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < +inf.0Initial program 98.5%
Taylor expanded in t around 0
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6476.0
Applied rewrites76.0%
Taylor expanded in z around 0
Applied rewrites76.5%
if -5e14 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < 4.99999999999999957e28 or +inf.0 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) Initial program 59.6%
Taylor expanded in t around inf
Applied rewrites96.4%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (<= (+ (/ (+ (* (- 1.0 t) (* z 2.0)) 2.0) (* t z)) (/ x y)) INFINITY) (+ (/ (fma (fma -2.0 t 2.0) z 2.0) (* t z)) (/ x y)) (+ -2.0 (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((((((1.0 - t) * (z * 2.0)) + 2.0) / (t * z)) + (x / y)) <= ((double) INFINITY)) {
tmp = (fma(fma(-2.0, t, 2.0), z, 2.0) / (t * z)) + (x / y);
} else {
tmp = -2.0 + (x / y);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(1.0 - t) * Float64(z * 2.0)) + 2.0) / Float64(t * z)) + Float64(x / y)) <= Inf) tmp = Float64(Float64(fma(fma(-2.0, t, 2.0), z, 2.0) / Float64(t * z)) + Float64(x / y)); else tmp = Float64(-2.0 + Float64(x / y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[(N[(N[(1.0 - t), $MachinePrecision] * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(-2.0 * t + 2.0), $MachinePrecision] * z + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(1 - t\right) \cdot \left(z \cdot 2\right) + 2}{t \cdot z} + \frac{x}{y} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-2, t, 2\right), z, 2\right)}{t \cdot z} + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{x}{y}\\
\end{array}
\end{array}
if (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf
Applied rewrites97.6%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ (fma 2.0 z 2.0) (* t z)) (/ x y))))
(if (<= (/ x y) -1e+38)
t_1
(if (<= (/ x y) 1.0) (/ (- (fma t -2.0 (/ 2.0 z)) -2.0) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (fma(2.0, z, 2.0) / (t * z)) + (x / y);
double tmp;
if ((x / y) <= -1e+38) {
tmp = t_1;
} else if ((x / y) <= 1.0) {
tmp = (fma(t, -2.0, (2.0 / z)) - -2.0) / t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(fma(2.0, z, 2.0) / Float64(t * z)) + Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -1e+38) tmp = t_1; elseif (Float64(x / y) <= 1.0) tmp = Float64(Float64(fma(t, -2.0, Float64(2.0 / z)) - -2.0) / t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(2.0 * z + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1e+38], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1.0], N[(N[(N[(t * -2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] - -2.0), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(2, z, 2\right)}{t \cdot z} + \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, -2, \frac{2}{z}\right) - -2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999977e37 or 1 < (/.f64 x y) Initial program 83.5%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
if -9.99999999999999977e37 < (/.f64 x y) < 1Initial program 83.4%
Taylor expanded in t around 0
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-lft-identityN/A
associate-*l/N/A
lower--.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.9
Applied rewrites99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites98.9%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- -2.0 (/ -2.0 t)) (/ x y))))
(if (<= (/ x y) -1.72e+50)
t_1
(if (<= (/ x y) 2.9e+105) (- (/ (- (/ 2.0 z) -2.0) t) 2.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (-2.0 - (-2.0 / t)) + (x / y);
double tmp;
if ((x / y) <= -1.72e+50) {
tmp = t_1;
} else if ((x / y) <= 2.9e+105) {
tmp = (((2.0 / z) - -2.0) / t) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((-2.0d0) - ((-2.0d0) / t)) + (x / y)
if ((x / y) <= (-1.72d+50)) then
tmp = t_1
else if ((x / y) <= 2.9d+105) then
tmp = (((2.0d0 / z) - (-2.0d0)) / t) - 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-2.0 - (-2.0 / t)) + (x / y);
double tmp;
if ((x / y) <= -1.72e+50) {
tmp = t_1;
} else if ((x / y) <= 2.9e+105) {
tmp = (((2.0 / z) - -2.0) / t) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-2.0 - (-2.0 / t)) + (x / y) tmp = 0 if (x / y) <= -1.72e+50: tmp = t_1 elif (x / y) <= 2.9e+105: tmp = (((2.0 / z) - -2.0) / t) - 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-2.0 - Float64(-2.0 / t)) + Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -1.72e+50) tmp = t_1; elseif (Float64(x / y) <= 2.9e+105) tmp = Float64(Float64(Float64(Float64(2.0 / z) - -2.0) / t) - 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-2.0 - (-2.0 / t)) + (x / y); tmp = 0.0; if ((x / y) <= -1.72e+50) tmp = t_1; elseif ((x / y) <= 2.9e+105) tmp = (((2.0 / z) - -2.0) / t) - 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-2.0 - N[(-2.0 / t), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1.72e+50], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2.9e+105], N[(N[(N[(N[(2.0 / z), $MachinePrecision] - -2.0), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-2 - \frac{-2}{t}\right) + \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -1.72 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2.9 \cdot 10^{+105}:\\
\;\;\;\;\frac{\frac{2}{z} - -2}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1.72e50 or 2.9000000000000001e105 < (/.f64 x y) Initial program 82.6%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
sub-negN/A
lower--.f64N/A
lower-/.f6491.3
Applied rewrites91.3%
if -1.72e50 < (/.f64 x y) < 2.9000000000000001e105Initial program 84.0%
Taylor expanded in x around 0
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+r+N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*r/N/A
metadata-evalN/A
associate--l+N/A
lower--.f64N/A
Applied rewrites95.3%
Final simplification93.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.15e+51) (/ x y) (if (<= (/ x y) 1.2e+113) (- (/ (- (/ 2.0 z) -2.0) t) 2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.15e+51) {
tmp = x / y;
} else if ((x / y) <= 1.2e+113) {
tmp = (((2.0 / z) - -2.0) / t) - 2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1.15d+51)) then
tmp = x / y
else if ((x / y) <= 1.2d+113) then
tmp = (((2.0d0 / z) - (-2.0d0)) / t) - 2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.15e+51) {
tmp = x / y;
} else if ((x / y) <= 1.2e+113) {
tmp = (((2.0 / z) - -2.0) / t) - 2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.15e+51: tmp = x / y elif (x / y) <= 1.2e+113: tmp = (((2.0 / z) - -2.0) / t) - 2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.15e+51) tmp = Float64(x / y); elseif (Float64(x / y) <= 1.2e+113) tmp = Float64(Float64(Float64(Float64(2.0 / z) - -2.0) / t) - 2.0); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1.15e+51) tmp = x / y; elseif ((x / y) <= 1.2e+113) tmp = (((2.0 / z) - -2.0) / t) - 2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.15e+51], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.2e+113], N[(N[(N[(N[(2.0 / z), $MachinePrecision] - -2.0), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.15 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.2 \cdot 10^{+113}:\\
\;\;\;\;\frac{\frac{2}{z} - -2}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.15000000000000003e51 or 1.19999999999999992e113 < (/.f64 x y) Initial program 82.4%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6482.4
Applied rewrites82.4%
Taylor expanded in x around inf
lower-/.f6482.3
Applied rewrites82.3%
if -1.15000000000000003e51 < (/.f64 x y) < 1.19999999999999992e113Initial program 84.1%
Taylor expanded in x around 0
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+r+N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*r/N/A
metadata-evalN/A
associate--l+N/A
lower--.f64N/A
Applied rewrites95.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- -2.0 (/ -2.0 t)) (/ x y))))
(if (<= z -1.0)
t_1
(if (<= z 5.5e-12) (+ (/ (fma (* -2.0 t) z 2.0) (* t z)) (/ x y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (-2.0 - (-2.0 / t)) + (x / y);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= 5.5e-12) {
tmp = (fma((-2.0 * t), z, 2.0) / (t * z)) + (x / y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(-2.0 - Float64(-2.0 / t)) + Float64(x / y)) tmp = 0.0 if (z <= -1.0) tmp = t_1; elseif (z <= 5.5e-12) tmp = Float64(Float64(fma(Float64(-2.0 * t), z, 2.0) / Float64(t * z)) + Float64(x / y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-2.0 - N[(-2.0 / t), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, 5.5e-12], N[(N[(N[(N[(-2.0 * t), $MachinePrecision] * z + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-2 - \frac{-2}{t}\right) + \frac{x}{y}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2 \cdot t, z, 2\right)}{t \cdot z} + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 5.5000000000000004e-12 < z Initial program 71.5%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
sub-negN/A
lower--.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
if -1 < z < 5.5000000000000004e-12Initial program 98.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
Applied rewrites98.1%
Taylor expanded in t around inf
lower-*.f6497.8
Applied rewrites97.8%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.65e+35) (/ x y) (if (<= (/ x y) 4.5e+59) (- (/ 2.0 t) 2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.65e+35) {
tmp = x / y;
} else if ((x / y) <= 4.5e+59) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1.65d+35)) then
tmp = x / y
else if ((x / y) <= 4.5d+59) then
tmp = (2.0d0 / t) - 2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.65e+35) {
tmp = x / y;
} else if ((x / y) <= 4.5e+59) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.65e+35: tmp = x / y elif (x / y) <= 4.5e+59: tmp = (2.0 / t) - 2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.65e+35) tmp = Float64(x / y); elseif (Float64(x / y) <= 4.5e+59) tmp = Float64(Float64(2.0 / t) - 2.0); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1.65e+35) tmp = x / y; elseif ((x / y) <= 4.5e+59) tmp = (2.0 / t) - 2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.65e+35], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.5e+59], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.65 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.5 \cdot 10^{+59}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.6500000000000001e35 or 4.49999999999999959e59 < (/.f64 x y) Initial program 83.7%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6483.7
Applied rewrites83.7%
Taylor expanded in x around inf
lower-/.f6479.0
Applied rewrites79.0%
if -1.6500000000000001e35 < (/.f64 x y) < 4.49999999999999959e59Initial program 83.3%
Taylor expanded in x around 0
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+r+N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*r/N/A
metadata-evalN/A
associate--l+N/A
lower--.f64N/A
Applied rewrites97.0%
Taylor expanded in z around inf
Applied rewrites62.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.65e+35) (/ x y) (if (<= (/ x y) 4.5e+59) (/ 2.0 t) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.65e+35) {
tmp = x / y;
} else if ((x / y) <= 4.5e+59) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1.65d+35)) then
tmp = x / y
else if ((x / y) <= 4.5d+59) then
tmp = 2.0d0 / t
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.65e+35) {
tmp = x / y;
} else if ((x / y) <= 4.5e+59) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.65e+35: tmp = x / y elif (x / y) <= 4.5e+59: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.65e+35) tmp = Float64(x / y); elseif (Float64(x / y) <= 4.5e+59) tmp = Float64(2.0 / t); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1.65e+35) tmp = x / y; elseif ((x / y) <= 4.5e+59) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.65e+35], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.5e+59], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.65 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.5 \cdot 10^{+59}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.6500000000000001e35 or 4.49999999999999959e59 < (/.f64 x y) Initial program 83.7%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6483.7
Applied rewrites83.7%
Taylor expanded in x around inf
lower-/.f6479.0
Applied rewrites79.0%
if -1.6500000000000001e35 < (/.f64 x y) < 4.49999999999999959e59Initial program 83.3%
Taylor expanded in t around 0
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6465.6
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites30.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (- -2.0 (/ -2.0 t)) (/ x y)))) (if (<= z -0.108) t_1 (if (<= z 4.4e-34) (+ (/ 2.0 (* t z)) (/ x y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (-2.0 - (-2.0 / t)) + (x / y);
double tmp;
if (z <= -0.108) {
tmp = t_1;
} else if (z <= 4.4e-34) {
tmp = (2.0 / (t * z)) + (x / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((-2.0d0) - ((-2.0d0) / t)) + (x / y)
if (z <= (-0.108d0)) then
tmp = t_1
else if (z <= 4.4d-34) then
tmp = (2.0d0 / (t * z)) + (x / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-2.0 - (-2.0 / t)) + (x / y);
double tmp;
if (z <= -0.108) {
tmp = t_1;
} else if (z <= 4.4e-34) {
tmp = (2.0 / (t * z)) + (x / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-2.0 - (-2.0 / t)) + (x / y) tmp = 0 if z <= -0.108: tmp = t_1 elif z <= 4.4e-34: tmp = (2.0 / (t * z)) + (x / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-2.0 - Float64(-2.0 / t)) + Float64(x / y)) tmp = 0.0 if (z <= -0.108) tmp = t_1; elseif (z <= 4.4e-34) tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(x / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-2.0 - (-2.0 / t)) + (x / y); tmp = 0.0; if (z <= -0.108) tmp = t_1; elseif (z <= 4.4e-34) tmp = (2.0 / (t * z)) + (x / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-2.0 - N[(-2.0 / t), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.108], t$95$1, If[LessEqual[z, 4.4e-34], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-2 - \frac{-2}{t}\right) + \frac{x}{y}\\
\mathbf{if}\;z \leq -0.108:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{t \cdot z} + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.107999999999999999 or 4.3999999999999998e-34 < z Initial program 72.3%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
sub-negN/A
lower--.f64N/A
lower-/.f6499.1
Applied rewrites99.1%
if -0.107999999999999999 < z < 4.3999999999999998e-34Initial program 98.1%
Taylor expanded in z around 0
Applied rewrites87.8%
Final simplification94.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ x y))))
(if (<= t -2.9e-121)
t_1
(if (<= t 4e-67)
(/ (* z 2.0) (* t z))
(if (<= t 1.02e+23) (/ (/ 2.0 t) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (t <= -2.9e-121) {
tmp = t_1;
} else if (t <= 4e-67) {
tmp = (z * 2.0) / (t * z);
} else if (t <= 1.02e+23) {
tmp = (2.0 / t) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) + (x / y)
if (t <= (-2.9d-121)) then
tmp = t_1
else if (t <= 4d-67) then
tmp = (z * 2.0d0) / (t * z)
else if (t <= 1.02d+23) then
tmp = (2.0d0 / t) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (t <= -2.9e-121) {
tmp = t_1;
} else if (t <= 4e-67) {
tmp = (z * 2.0) / (t * z);
} else if (t <= 1.02e+23) {
tmp = (2.0 / t) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if t <= -2.9e-121: tmp = t_1 elif t <= 4e-67: tmp = (z * 2.0) / (t * z) elif t <= 1.02e+23: tmp = (2.0 / t) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (t <= -2.9e-121) tmp = t_1; elseif (t <= 4e-67) tmp = Float64(Float64(z * 2.0) / Float64(t * z)); elseif (t <= 1.02e+23) tmp = Float64(Float64(2.0 / t) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (t <= -2.9e-121) tmp = t_1; elseif (t <= 4e-67) tmp = (z * 2.0) / (t * z); elseif (t <= 1.02e+23) tmp = (2.0 / t) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e-121], t$95$1, If[LessEqual[t, 4e-67], N[(N[(z * 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+23], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-67}:\\
\;\;\;\;\frac{z \cdot 2}{t \cdot z}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+23}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9e-121 or 1.02e23 < t Initial program 71.6%
Taylor expanded in t around inf
Applied rewrites80.0%
if -2.9e-121 < t < 3.99999999999999977e-67Initial program 97.8%
Taylor expanded in t around 0
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in z around 0
Applied rewrites83.7%
Taylor expanded in z around inf
Applied rewrites60.3%
if 3.99999999999999977e-67 < t < 1.02e23Initial program 99.5%
Taylor expanded in t around 0
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-lft-identityN/A
associate-*l/N/A
lower--.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in z around 0
Applied rewrites58.1%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ x y))))
(if (<= t -2.9e-121)
t_1
(if (<= t 4e-67)
(/ (* z 2.0) (* t z))
(if (<= t 1.02e+23) (/ 2.0 (* t z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (t <= -2.9e-121) {
tmp = t_1;
} else if (t <= 4e-67) {
tmp = (z * 2.0) / (t * z);
} else if (t <= 1.02e+23) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) + (x / y)
if (t <= (-2.9d-121)) then
tmp = t_1
else if (t <= 4d-67) then
tmp = (z * 2.0d0) / (t * z)
else if (t <= 1.02d+23) then
tmp = 2.0d0 / (t * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (t <= -2.9e-121) {
tmp = t_1;
} else if (t <= 4e-67) {
tmp = (z * 2.0) / (t * z);
} else if (t <= 1.02e+23) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if t <= -2.9e-121: tmp = t_1 elif t <= 4e-67: tmp = (z * 2.0) / (t * z) elif t <= 1.02e+23: tmp = 2.0 / (t * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (t <= -2.9e-121) tmp = t_1; elseif (t <= 4e-67) tmp = Float64(Float64(z * 2.0) / Float64(t * z)); elseif (t <= 1.02e+23) tmp = Float64(2.0 / Float64(t * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (t <= -2.9e-121) tmp = t_1; elseif (t <= 4e-67) tmp = (z * 2.0) / (t * z); elseif (t <= 1.02e+23) tmp = 2.0 / (t * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e-121], t$95$1, If[LessEqual[t, 4e-67], N[(N[(z * 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+23], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-67}:\\
\;\;\;\;\frac{z \cdot 2}{t \cdot z}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+23}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9e-121 or 1.02e23 < t Initial program 71.6%
Taylor expanded in t around inf
Applied rewrites80.0%
if -2.9e-121 < t < 3.99999999999999977e-67Initial program 97.8%
Taylor expanded in t around 0
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in z around 0
Applied rewrites83.7%
Taylor expanded in z around inf
Applied rewrites60.3%
if 3.99999999999999977e-67 < t < 1.02e23Initial program 99.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6458.1
Applied rewrites58.1%
Final simplification71.0%
(FPCore (x y z t) :precision binary64 (/ 2.0 t))
double code(double x, double y, double z, double t) {
return 2.0 / t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 2.0d0 / t
end function
public static double code(double x, double y, double z, double t) {
return 2.0 / t;
}
def code(x, y, z, t): return 2.0 / t
function code(x, y, z, t) return Float64(2.0 / t) end
function tmp = code(x, y, z, t) tmp = 2.0 / t; end
code[x_, y_, z_, t_] := N[(2.0 / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t}
\end{array}
Initial program 83.5%
Taylor expanded in t around 0
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6448.3
Applied rewrites48.3%
Taylor expanded in z around inf
Applied rewrites22.4%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024332
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))