
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
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 * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
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 * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- x (* y z)) (- x (* z t)))) (+ x 1.0))))
(if (<= t_1 -5e+90)
(/ (/ y (- -1.0 x)) (- (/ x z) t))
(if (<= t_1 5e+277)
t_1
(+ (/ x (+ x 1.0)) (/ (+ (/ y (+ x 1.0)) (/ x (* z (- -1.0 x)))) t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= -5e+90) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t_1 <= 5e+277) {
tmp = t_1;
} else {
tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t);
}
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 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0d0)
if (t_1 <= (-5d+90)) then
tmp = (y / ((-1.0d0) - x)) / ((x / z) - t)
else if (t_1 <= 5d+277) then
tmp = t_1
else
tmp = (x / (x + 1.0d0)) + (((y / (x + 1.0d0)) + (x / (z * ((-1.0d0) - x)))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= -5e+90) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t_1 <= 5e+277) {
tmp = t_1;
} else {
tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0) tmp = 0 if t_1 <= -5e+90: tmp = (y / (-1.0 - x)) / ((x / z) - t) elif t_1 <= 5e+277: tmp = t_1 else: tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= -5e+90) tmp = Float64(Float64(y / Float64(-1.0 - x)) / Float64(Float64(x / z) - t)); elseif (t_1 <= 5e+277) tmp = t_1; else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(Float64(Float64(y / Float64(x + 1.0)) + Float64(x / Float64(z * Float64(-1.0 - x)))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0); tmp = 0.0; if (t_1 <= -5e+90) tmp = (y / (-1.0 - x)) / ((x / z) - t); elseif (t_1 <= 5e+277) tmp = t_1; else tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+90], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+277], t$95$1, N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x / N[(z * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{x - y \cdot z}{x - z \cdot t}}{x + 1}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\frac{y}{-1 - x}}{\frac{x}{z} - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+277}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{\frac{y}{x + 1} + \frac{x}{z \cdot \left(-1 - x\right)}}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -5.0000000000000004e90Initial program 66.9%
*-commutative66.9%
Simplified66.9%
Taylor expanded in z around inf 66.9%
mul-1-neg66.9%
unsub-neg66.9%
Simplified66.9%
Taylor expanded in y around inf 94.9%
associate-/r*95.1%
+-commutative95.1%
Simplified95.1%
if -5.0000000000000004e90 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 4.99999999999999982e277Initial program 98.9%
if 4.99999999999999982e277 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in t around -inf 86.9%
+-commutative86.9%
mul-1-neg86.9%
unsub-neg86.9%
+-commutative86.9%
Simplified86.9%
Final simplification97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- x (* y z)) (- x (* z t)))) (+ x 1.0))))
(if (<= t_1 -5e+90)
(/ (/ y (- -1.0 x)) (- (/ x z) t))
(if (<= t_1 5e+277) t_1 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= -5e+90) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t_1 <= 5e+277) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
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 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0d0)
if (t_1 <= (-5d+90)) then
tmp = (y / ((-1.0d0) - x)) / ((x / z) - t)
else if (t_1 <= 5d+277) then
tmp = t_1
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= -5e+90) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t_1 <= 5e+277) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0) tmp = 0 if t_1 <= -5e+90: tmp = (y / (-1.0 - x)) / ((x / z) - t) elif t_1 <= 5e+277: tmp = t_1 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= -5e+90) tmp = Float64(Float64(y / Float64(-1.0 - x)) / Float64(Float64(x / z) - t)); elseif (t_1 <= 5e+277) tmp = t_1; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0); tmp = 0.0; if (t_1 <= -5e+90) tmp = (y / (-1.0 - x)) / ((x / z) - t); elseif (t_1 <= 5e+277) tmp = t_1; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+90], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+277], t$95$1, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{x - y \cdot z}{x - z \cdot t}}{x + 1}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\frac{y}{-1 - x}}{\frac{x}{z} - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+277}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -5.0000000000000004e90Initial program 66.9%
*-commutative66.9%
Simplified66.9%
Taylor expanded in z around inf 66.9%
mul-1-neg66.9%
unsub-neg66.9%
Simplified66.9%
Taylor expanded in y around inf 94.9%
associate-/r*95.1%
+-commutative95.1%
Simplified95.1%
if -5.0000000000000004e90 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 4.99999999999999982e277Initial program 98.9%
if 4.99999999999999982e277 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in z around inf 86.9%
Final simplification97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -2.4e-5)
t_1
(if (<= t 9.8e-252)
(+ 1.0 (* (/ y x) (/ z (- -1.0 x))))
(if (<= t 5.4e-128)
(/ (/ y (- -1.0 x)) (- (/ x z) t))
(if (<= t 7800000.0) (/ (+ x (/ x (- x (* z t)))) (+ x 1.0)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.4e-5) {
tmp = t_1;
} else if (t <= 9.8e-252) {
tmp = 1.0 + ((y / x) * (z / (-1.0 - x)));
} else if (t <= 5.4e-128) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t <= 7800000.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.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 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-2.4d-5)) then
tmp = t_1
else if (t <= 9.8d-252) then
tmp = 1.0d0 + ((y / x) * (z / ((-1.0d0) - x)))
else if (t <= 5.4d-128) then
tmp = (y / ((-1.0d0) - x)) / ((x / z) - t)
else if (t <= 7800000.0d0) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.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 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.4e-5) {
tmp = t_1;
} else if (t <= 9.8e-252) {
tmp = 1.0 + ((y / x) * (z / (-1.0 - x)));
} else if (t <= 5.4e-128) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t <= 7800000.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -2.4e-5: tmp = t_1 elif t <= 9.8e-252: tmp = 1.0 + ((y / x) * (z / (-1.0 - x))) elif t <= 5.4e-128: tmp = (y / (-1.0 - x)) / ((x / z) - t) elif t <= 7800000.0: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -2.4e-5) tmp = t_1; elseif (t <= 9.8e-252) tmp = Float64(1.0 + Float64(Float64(y / x) * Float64(z / Float64(-1.0 - x)))); elseif (t <= 5.4e-128) tmp = Float64(Float64(y / Float64(-1.0 - x)) / Float64(Float64(x / z) - t)); elseif (t <= 7800000.0) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -2.4e-5) tmp = t_1; elseif (t <= 9.8e-252) tmp = 1.0 + ((y / x) * (z / (-1.0 - x))); elseif (t <= 5.4e-128) tmp = (y / (-1.0 - x)) / ((x / z) - t); elseif (t <= 7800000.0) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e-5], t$95$1, If[LessEqual[t, 9.8e-252], N[(1.0 + N[(N[(y / x), $MachinePrecision] * N[(z / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-128], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7800000.0], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{-252}:\\
\;\;\;\;1 + \frac{y}{x} \cdot \frac{z}{-1 - x}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-128}:\\
\;\;\;\;\frac{\frac{y}{-1 - x}}{\frac{x}{z} - t}\\
\mathbf{elif}\;t \leq 7800000:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.4000000000000001e-5 or 7.8e6 < t Initial program 81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in z around inf 91.2%
if -2.4000000000000001e-5 < t < 9.7999999999999994e-252Initial program 94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in t around 0 84.9%
associate-+r+84.9%
mul-1-neg84.9%
unsub-neg84.9%
+-commutative84.9%
associate-/l*87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in y around 0 84.8%
mul-1-neg84.8%
sub-neg84.8%
times-frac87.4%
+-commutative87.4%
Simplified87.4%
if 9.7999999999999994e-252 < t < 5.40000000000000011e-128Initial program 82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in z around inf 82.3%
mul-1-neg82.3%
unsub-neg82.3%
Simplified82.3%
Taylor expanded in y around inf 87.7%
associate-/r*87.8%
+-commutative87.8%
Simplified87.8%
if 5.40000000000000011e-128 < t < 7.8e6Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in y around 0 68.8%
+-commutative68.8%
Simplified68.8%
Final simplification87.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -2.75e-5)
t_1
(if (<= t 9.8e-252)
(+ 1.0 (* (/ y x) (/ z (- -1.0 x))))
(if (<= t 3.5e-134)
(/ (/ y (- -1.0 x)) (- (/ x z) t))
(if (<= t 7800000.0)
(/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.75e-5) {
tmp = t_1;
} else if (t <= 9.8e-252) {
tmp = 1.0 + ((y / x) * (z / (-1.0 - x)));
} else if (t <= 3.5e-134) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t <= 7800000.0) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.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 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-2.75d-5)) then
tmp = t_1
else if (t <= 9.8d-252) then
tmp = 1.0d0 + ((y / x) * (z / ((-1.0d0) - x)))
else if (t <= 3.5d-134) then
tmp = (y / ((-1.0d0) - x)) / ((x / z) - t)
else if (t <= 7800000.0d0) then
tmp = ((x + 1.0d0) - (y * (z / x))) / (x + 1.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 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.75e-5) {
tmp = t_1;
} else if (t <= 9.8e-252) {
tmp = 1.0 + ((y / x) * (z / (-1.0 - x)));
} else if (t <= 3.5e-134) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t <= 7800000.0) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -2.75e-5: tmp = t_1 elif t <= 9.8e-252: tmp = 1.0 + ((y / x) * (z / (-1.0 - x))) elif t <= 3.5e-134: tmp = (y / (-1.0 - x)) / ((x / z) - t) elif t <= 7800000.0: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -2.75e-5) tmp = t_1; elseif (t <= 9.8e-252) tmp = Float64(1.0 + Float64(Float64(y / x) * Float64(z / Float64(-1.0 - x)))); elseif (t <= 3.5e-134) tmp = Float64(Float64(y / Float64(-1.0 - x)) / Float64(Float64(x / z) - t)); elseif (t <= 7800000.0) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -2.75e-5) tmp = t_1; elseif (t <= 9.8e-252) tmp = 1.0 + ((y / x) * (z / (-1.0 - x))); elseif (t <= 3.5e-134) tmp = (y / (-1.0 - x)) / ((x / z) - t); elseif (t <= 7800000.0) tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.75e-5], t$95$1, If[LessEqual[t, 9.8e-252], N[(1.0 + N[(N[(y / x), $MachinePrecision] * N[(z / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-134], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7800000.0], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -2.75 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{-252}:\\
\;\;\;\;1 + \frac{y}{x} \cdot \frac{z}{-1 - x}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{y}{-1 - x}}{\frac{x}{z} - t}\\
\mathbf{elif}\;t \leq 7800000:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.7500000000000001e-5 or 7.8e6 < t Initial program 81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in z around inf 91.2%
if -2.7500000000000001e-5 < t < 9.7999999999999994e-252Initial program 94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in t around 0 84.9%
associate-+r+84.9%
mul-1-neg84.9%
unsub-neg84.9%
+-commutative84.9%
associate-/l*87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in y around 0 84.8%
mul-1-neg84.8%
sub-neg84.8%
times-frac87.4%
+-commutative87.4%
Simplified87.4%
if 9.7999999999999994e-252 < t < 3.4999999999999998e-134Initial program 81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in z around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
Simplified81.1%
Taylor expanded in y around inf 86.9%
associate-/r*87.0%
+-commutative87.0%
Simplified87.0%
if 3.4999999999999998e-134 < t < 7.8e6Initial program 94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in t around 0 74.1%
associate-+r+74.1%
mul-1-neg74.1%
unsub-neg74.1%
+-commutative74.1%
associate-/l*76.9%
+-commutative76.9%
Simplified76.9%
Final simplification87.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (* (/ y x) (/ z (- -1.0 x)))))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -0.0038)
t_2
(if (<= t 1.16e-229)
t_1
(if (<= t 1.4e-162)
(/ y (* t (+ x 1.0)))
(if (<= t 3.15e-56) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((y / x) * (z / (-1.0 - x)));
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -0.0038) {
tmp = t_2;
} else if (t <= 1.16e-229) {
tmp = t_1;
} else if (t <= 1.4e-162) {
tmp = y / (t * (x + 1.0));
} else if (t <= 3.15e-56) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = 1.0d0 + ((y / x) * (z / ((-1.0d0) - x)))
t_2 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-0.0038d0)) then
tmp = t_2
else if (t <= 1.16d-229) then
tmp = t_1
else if (t <= 1.4d-162) then
tmp = y / (t * (x + 1.0d0))
else if (t <= 3.15d-56) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((y / x) * (z / (-1.0 - x)));
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -0.0038) {
tmp = t_2;
} else if (t <= 1.16e-229) {
tmp = t_1;
} else if (t <= 1.4e-162) {
tmp = y / (t * (x + 1.0));
} else if (t <= 3.15e-56) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + ((y / x) * (z / (-1.0 - x))) t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -0.0038: tmp = t_2 elif t <= 1.16e-229: tmp = t_1 elif t <= 1.4e-162: tmp = y / (t * (x + 1.0)) elif t <= 3.15e-56: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(y / x) * Float64(z / Float64(-1.0 - x)))) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -0.0038) tmp = t_2; elseif (t <= 1.16e-229) tmp = t_1; elseif (t <= 1.4e-162) tmp = Float64(y / Float64(t * Float64(x + 1.0))); elseif (t <= 3.15e-56) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + ((y / x) * (z / (-1.0 - x))); t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -0.0038) tmp = t_2; elseif (t <= 1.16e-229) tmp = t_1; elseif (t <= 1.4e-162) tmp = y / (t * (x + 1.0)); elseif (t <= 3.15e-56) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(N[(y / x), $MachinePrecision] * N[(z / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.0038], t$95$2, If[LessEqual[t, 1.16e-229], t$95$1, If[LessEqual[t, 1.4e-162], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.15e-56], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{y}{x} \cdot \frac{z}{-1 - x}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -0.0038:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-162}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{elif}\;t \leq 3.15 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -0.00379999999999999999 or 3.1499999999999999e-56 < t Initial program 83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in z around inf 87.6%
if -0.00379999999999999999 < t < 1.16000000000000002e-229 or 1.40000000000000011e-162 < t < 3.1499999999999999e-56Initial program 92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in t around 0 81.8%
associate-+r+81.8%
mul-1-neg81.8%
unsub-neg81.8%
+-commutative81.8%
associate-/l*85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
sub-neg81.8%
times-frac84.7%
+-commutative84.7%
Simplified84.7%
if 1.16000000000000002e-229 < t < 1.40000000000000011e-162Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in y around inf 75.8%
associate-/l*87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in z around inf 87.6%
+-commutative87.6%
Simplified87.6%
Final simplification86.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (* (/ y x) (/ z (- -1.0 x)))))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -2.5e-5)
t_2
(if (<= t 9.8e-252)
t_1
(if (<= t 1.9e-144)
(/ (/ y (- -1.0 x)) (- (/ x z) t))
(if (<= t 3.7e-56) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((y / x) * (z / (-1.0 - x)));
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.5e-5) {
tmp = t_2;
} else if (t <= 9.8e-252) {
tmp = t_1;
} else if (t <= 1.9e-144) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t <= 3.7e-56) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = 1.0d0 + ((y / x) * (z / ((-1.0d0) - x)))
t_2 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-2.5d-5)) then
tmp = t_2
else if (t <= 9.8d-252) then
tmp = t_1
else if (t <= 1.9d-144) then
tmp = (y / ((-1.0d0) - x)) / ((x / z) - t)
else if (t <= 3.7d-56) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((y / x) * (z / (-1.0 - x)));
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.5e-5) {
tmp = t_2;
} else if (t <= 9.8e-252) {
tmp = t_1;
} else if (t <= 1.9e-144) {
tmp = (y / (-1.0 - x)) / ((x / z) - t);
} else if (t <= 3.7e-56) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + ((y / x) * (z / (-1.0 - x))) t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -2.5e-5: tmp = t_2 elif t <= 9.8e-252: tmp = t_1 elif t <= 1.9e-144: tmp = (y / (-1.0 - x)) / ((x / z) - t) elif t <= 3.7e-56: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(y / x) * Float64(z / Float64(-1.0 - x)))) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -2.5e-5) tmp = t_2; elseif (t <= 9.8e-252) tmp = t_1; elseif (t <= 1.9e-144) tmp = Float64(Float64(y / Float64(-1.0 - x)) / Float64(Float64(x / z) - t)); elseif (t <= 3.7e-56) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + ((y / x) * (z / (-1.0 - x))); t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -2.5e-5) tmp = t_2; elseif (t <= 9.8e-252) tmp = t_1; elseif (t <= 1.9e-144) tmp = (y / (-1.0 - x)) / ((x / z) - t); elseif (t <= 3.7e-56) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(N[(y / x), $MachinePrecision] * N[(z / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e-5], t$95$2, If[LessEqual[t, 9.8e-252], t$95$1, If[LessEqual[t, 1.9e-144], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-56], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{y}{x} \cdot \frac{z}{-1 - x}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{-252}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-144}:\\
\;\;\;\;\frac{\frac{y}{-1 - x}}{\frac{x}{z} - t}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.50000000000000012e-5 or 3.7000000000000002e-56 < t Initial program 83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in z around inf 87.6%
if -2.50000000000000012e-5 < t < 9.7999999999999994e-252 or 1.89999999999999996e-144 < t < 3.7000000000000002e-56Initial program 93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in t around 0 83.0%
associate-+r+83.0%
mul-1-neg83.0%
unsub-neg83.0%
+-commutative83.0%
associate-/l*86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in y around 0 82.9%
mul-1-neg82.9%
sub-neg82.9%
times-frac86.0%
+-commutative86.0%
Simplified86.0%
if 9.7999999999999994e-252 < t < 1.89999999999999996e-144Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in z around inf 85.6%
mul-1-neg85.6%
unsub-neg85.6%
Simplified85.6%
Taylor expanded in y around inf 84.9%
associate-/r*85.0%
+-commutative85.0%
Simplified85.0%
Final simplification86.9%
(FPCore (x y z t) :precision binary64 (if (<= x -3.2e-21) 1.0 (if (<= x 5.5e-9) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.2e-21) {
tmp = 1.0;
} else if (x <= 5.5e-9) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
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 <= (-3.2d-21)) then
tmp = 1.0d0
else if (x <= 5.5d-9) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.2e-21) {
tmp = 1.0;
} else if (x <= 5.5e-9) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.2e-21: tmp = 1.0 elif x <= 5.5e-9: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.2e-21) tmp = 1.0; elseif (x <= 5.5e-9) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.2e-21) tmp = 1.0; elseif (x <= 5.5e-9) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.2e-21], 1.0, If[LessEqual[x, 5.5e-9], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-21}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.2000000000000002e-21 or 5.4999999999999996e-9 < x Initial program 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in z around inf 70.0%
Taylor expanded in x around inf 89.7%
if -3.2000000000000002e-21 < x < 5.4999999999999996e-9Initial program 84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in z around inf 64.4%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1.6e-21) 1.0 (if (<= x 4.1e-13) (/ y (* t (+ x 1.0))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-21) {
tmp = 1.0;
} else if (x <= 4.1e-13) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 1.0;
}
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 <= (-1.6d-21)) then
tmp = 1.0d0
else if (x <= 4.1d-13) then
tmp = y / (t * (x + 1.0d0))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-21) {
tmp = 1.0;
} else if (x <= 4.1e-13) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.6e-21: tmp = 1.0 elif x <= 4.1e-13: tmp = y / (t * (x + 1.0)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.6e-21) tmp = 1.0; elseif (x <= 4.1e-13) tmp = Float64(y / Float64(t * Float64(x + 1.0))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.6e-21) tmp = 1.0; elseif (x <= 4.1e-13) tmp = y / (t * (x + 1.0)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.6e-21], 1.0, If[LessEqual[x, 4.1e-13], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-13}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.6000000000000001e-21 or 4.1000000000000002e-13 < x Initial program 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in z around inf 70.0%
Taylor expanded in x around inf 89.7%
if -1.6000000000000001e-21 < x < 4.1000000000000002e-13Initial program 84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in y around inf 47.9%
associate-/l*53.3%
+-commutative53.3%
Simplified53.3%
Taylor expanded in z around inf 48.1%
+-commutative48.1%
Simplified48.1%
Final simplification68.9%
(FPCore (x y z t) :precision binary64 (if (<= x -1.6e-21) 1.0 (if (<= x 3.6e-12) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-21) {
tmp = 1.0;
} else if (x <= 3.6e-12) {
tmp = y / t;
} else {
tmp = 1.0;
}
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 <= (-1.6d-21)) then
tmp = 1.0d0
else if (x <= 3.6d-12) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-21) {
tmp = 1.0;
} else if (x <= 3.6e-12) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.6e-21: tmp = 1.0 elif x <= 3.6e-12: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.6e-21) tmp = 1.0; elseif (x <= 3.6e-12) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.6e-21) tmp = 1.0; elseif (x <= 3.6e-12) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.6e-21], 1.0, If[LessEqual[x, 3.6e-12], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.6000000000000001e-21 or 3.6e-12 < x Initial program 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in z around inf 70.0%
Taylor expanded in x around inf 89.7%
if -1.6000000000000001e-21 < x < 3.6e-12Initial program 84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in z around inf 64.4%
Taylor expanded in x around 0 48.1%
Final simplification68.9%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
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 = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around inf 67.2%
Taylor expanded in x around inf 53.2%
Final simplification53.2%
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
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 / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2024080
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))