
(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 15 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 (+ (/ x y) (+ (/ (/ 2.0 t) z) (- (/ 2.0 t) 2.0))))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 / t) / z) + ((2.0 / t) - 2.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) + (((2.0d0 / t) / z) + ((2.0d0 / t) - 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 / t) / z) + ((2.0 / t) - 2.0));
}
def code(x, y, z, t): return (x / y) + (((2.0 / t) / z) + ((2.0 / t) - 2.0))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 / t) / z) + Float64(Float64(2.0 / t) - 2.0))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 / t) / z) + ((2.0 / t) - 2.0)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{\frac{2}{t}}{z} + \left(\frac{2}{t} - 2\right)\right)
\end{array}
Initial program 85.1%
Taylor expanded in t around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-/r*98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ 2.0 t) -2.0)) (t_2 (- (/ x y) 2.0)))
(if (<= z -5.1e+157)
t_2
(if (<= z -2e+35)
t_1
(if (<= z -3.8e-117)
t_2
(if (<= z 2.4e-108)
(/ 2.0 (* t z))
(if (or (<= z 1.6e+51) (not (<= z 3.4e+123))) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) + -2.0;
double t_2 = (x / y) - 2.0;
double tmp;
if (z <= -5.1e+157) {
tmp = t_2;
} else if (z <= -2e+35) {
tmp = t_1;
} else if (z <= -3.8e-117) {
tmp = t_2;
} else if (z <= 2.4e-108) {
tmp = 2.0 / (t * z);
} else if ((z <= 1.6e+51) || !(z <= 3.4e+123)) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (2.0d0 / t) + (-2.0d0)
t_2 = (x / y) - 2.0d0
if (z <= (-5.1d+157)) then
tmp = t_2
else if (z <= (-2d+35)) then
tmp = t_1
else if (z <= (-3.8d-117)) then
tmp = t_2
else if (z <= 2.4d-108) then
tmp = 2.0d0 / (t * z)
else if ((z <= 1.6d+51) .or. (.not. (z <= 3.4d+123))) then
tmp = t_2
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 / t) + -2.0;
double t_2 = (x / y) - 2.0;
double tmp;
if (z <= -5.1e+157) {
tmp = t_2;
} else if (z <= -2e+35) {
tmp = t_1;
} else if (z <= -3.8e-117) {
tmp = t_2;
} else if (z <= 2.4e-108) {
tmp = 2.0 / (t * z);
} else if ((z <= 1.6e+51) || !(z <= 3.4e+123)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / t) + -2.0 t_2 = (x / y) - 2.0 tmp = 0 if z <= -5.1e+157: tmp = t_2 elif z <= -2e+35: tmp = t_1 elif z <= -3.8e-117: tmp = t_2 elif z <= 2.4e-108: tmp = 2.0 / (t * z) elif (z <= 1.6e+51) or not (z <= 3.4e+123): tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / t) + -2.0) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -5.1e+157) tmp = t_2; elseif (z <= -2e+35) tmp = t_1; elseif (z <= -3.8e-117) tmp = t_2; elseif (z <= 2.4e-108) tmp = Float64(2.0 / Float64(t * z)); elseif ((z <= 1.6e+51) || !(z <= 3.4e+123)) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / t) + -2.0; t_2 = (x / y) - 2.0; tmp = 0.0; if (z <= -5.1e+157) tmp = t_2; elseif (z <= -2e+35) tmp = t_1; elseif (z <= -3.8e-117) tmp = t_2; elseif (z <= 2.4e-108) tmp = 2.0 / (t * z); elseif ((z <= 1.6e+51) || ~((z <= 3.4e+123))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -5.1e+157], t$95$2, If[LessEqual[z, -2e+35], t$95$1, If[LessEqual[z, -3.8e-117], t$95$2, If[LessEqual[z, 2.4e-108], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.6e+51], N[Not[LessEqual[z, 3.4e+123]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t} + -2\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -5.1 \cdot 10^{+157}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-117}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-108}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+51} \lor \neg \left(z \leq 3.4 \cdot 10^{+123}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.09999999999999999e157 or -1.9999999999999999e35 < z < -3.79999999999999972e-117 or 2.40000000000000017e-108 < z < 1.6000000000000001e51 or 3.40000000000000001e123 < z Initial program 73.3%
Taylor expanded in t around inf 70.4%
if -5.09999999999999999e157 < z < -1.9999999999999999e35 or 1.6000000000000001e51 < z < 3.40000000000000001e123Initial program 90.4%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in x around 0 81.0%
sub-neg81.0%
associate-*r/81.0%
metadata-eval81.0%
associate-*r/81.0%
metadata-eval81.0%
metadata-eval81.0%
+-commutative81.0%
associate-+r+81.0%
+-commutative81.0%
Simplified81.0%
Taylor expanded in z around inf 81.0%
sub-neg81.0%
associate-*r/81.0%
metadata-eval81.0%
metadata-eval81.0%
Simplified81.0%
if -3.79999999999999972e-117 < z < 2.40000000000000017e-108Initial program 97.0%
Taylor expanded in t around 0 97.0%
associate--l+97.0%
associate-*r/97.0%
metadata-eval97.0%
associate-/r*97.0%
Simplified97.0%
Taylor expanded in z around 0 70.6%
Final simplification71.8%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1.05e-16)
(/ x y)
(if (<= (/ x y) 0.0)
-2.0
(if (<= (/ x y) 2.2e-192) (/ 2.0 t) (if (<= (/ x y) 2.0) -2.0 (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.05e-16) {
tmp = x / y;
} else if ((x / y) <= 0.0) {
tmp = -2.0;
} else if ((x / y) <= 2.2e-192) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -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.05d-16)) then
tmp = x / y
else if ((x / y) <= 0.0d0) then
tmp = -2.0d0
else if ((x / y) <= 2.2d-192) then
tmp = 2.0d0 / t
else if ((x / y) <= 2.0d0) then
tmp = -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.05e-16) {
tmp = x / y;
} else if ((x / y) <= 0.0) {
tmp = -2.0;
} else if ((x / y) <= 2.2e-192) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.05e-16: tmp = x / y elif (x / y) <= 0.0: tmp = -2.0 elif (x / y) <= 2.2e-192: tmp = 2.0 / t elif (x / y) <= 2.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.05e-16) tmp = Float64(x / y); elseif (Float64(x / y) <= 0.0) tmp = -2.0; elseif (Float64(x / y) <= 2.2e-192) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2.0) tmp = -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.05e-16) tmp = x / y; elseif ((x / y) <= 0.0) tmp = -2.0; elseif ((x / y) <= 2.2e-192) tmp = 2.0 / t; elseif ((x / y) <= 2.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.05e-16], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.0], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 2.2e-192], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.0], -2.0, N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.05 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 0:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.2 \cdot 10^{-192}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.0500000000000001e-16 or 2 < (/.f64 x y) Initial program 84.5%
Taylor expanded in x around inf 66.5%
if -1.0500000000000001e-16 < (/.f64 x y) < -0.0 or 2.20000000000000006e-192 < (/.f64 x y) < 2Initial program 84.5%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in t around inf 39.4%
if -0.0 < (/.f64 x y) < 2.20000000000000006e-192Initial program 93.2%
Taylor expanded in z around inf 64.1%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in t around 0 52.4%
Final simplification54.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -400000000000.0) (not (<= (/ x y) 2600000000.0))) (+ (/ x y) (/ (/ 2.0 t) z)) (+ (/ 2.0 (* t z)) (+ (/ 2.0 t) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -400000000000.0) || !((x / y) <= 2600000000.0)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.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 / y) <= (-400000000000.0d0)) .or. (.not. ((x / y) <= 2600000000.0d0))) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = (2.0d0 / (t * z)) + ((2.0d0 / t) + (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -400000000000.0) || !((x / y) <= 2600000000.0)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -400000000000.0) or not ((x / y) <= 2600000000.0): tmp = (x / y) + ((2.0 / t) / z) else: tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -400000000000.0) || !(Float64(x / y) <= 2600000000.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(2.0 / t) + -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -400000000000.0) || ~(((x / y) <= 2600000000.0))) tmp = (x / y) + ((2.0 / t) / z); else tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -400000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2600000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -400000000000 \lor \neg \left(\frac{x}{y} \leq 2600000000\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \left(\frac{2}{t} + -2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -4e11 or 2.6e9 < (/.f64 x y) Initial program 82.9%
Taylor expanded in z around 0 90.3%
associate-/r*90.3%
Simplified90.3%
if -4e11 < (/.f64 x y) < 2.6e9Initial program 87.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-+r+98.7%
+-commutative98.7%
Simplified98.7%
Final simplification94.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.05e-14) (not (<= (/ x y) 2.0))) (+ (/ x y) (/ (+ 2.0 (/ 2.0 z)) t)) (+ (/ 2.0 (* t z)) (+ (/ 2.0 t) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.05e-14) || !((x / y) <= 2.0)) {
tmp = (x / y) + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.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 / y) <= (-2.05d-14)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (2.0d0 / (t * z)) + ((2.0d0 / t) + (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.05e-14) || !((x / y) <= 2.0)) {
tmp = (x / y) + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.05e-14) or not ((x / y) <= 2.0): tmp = (x / y) + ((2.0 + (2.0 / z)) / t) else: tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.05e-14) || !(Float64(x / y) <= 2.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(2.0 / t) + -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.05e-14) || ~(((x / y) <= 2.0))) tmp = (x / y) + ((2.0 + (2.0 / z)) / t); else tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.05e-14], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.05 \cdot 10^{-14} \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \left(\frac{2}{t} + -2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -2.0500000000000001e-14 or 2 < (/.f64 x y) Initial program 84.3%
Taylor expanded in t around 0 96.1%
Taylor expanded in z around 0 96.8%
*-commutative96.8%
associate-*r/96.8%
metadata-eval96.8%
*-commutative96.8%
associate-/l/96.8%
*-rgt-identity96.8%
associate-*r/96.7%
metadata-eval96.7%
associate-*l/96.7%
associate-*l*96.7%
associate-*r/96.7%
metadata-eval96.7%
distribute-lft-in96.7%
associate-*l/96.7%
*-lft-identity96.7%
Simplified96.7%
if -2.0500000000000001e-14 < (/.f64 x y) < 2Initial program 85.9%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Simplified99.5%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -5e-14)
(+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z)))
(if (<= (/ x y) 5e-6)
(+ (/ 2.0 (* t z)) (+ (/ 2.0 t) -2.0))
(+ (/ x y) (/ (+ 2.0 (/ 2.0 z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-14) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else if ((x / y) <= 5e-6) {
tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 + (2.0 / z)) / 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) :: tmp
if ((x / y) <= (-5d-14)) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (t * z))
else if ((x / y) <= 5d-6) then
tmp = (2.0d0 / (t * z)) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-14) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else if ((x / y) <= 5e-6) {
tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e-14: tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)) elif (x / y) <= 5e-6: tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0) else: tmp = (x / y) + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e-14) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))); elseif (Float64(x / y) <= 5e-6) tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e-14) tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)); elseif ((x / y) <= 5e-6) tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0); else tmp = (x / y) + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e-14], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-6], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{t \cdot z} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.0000000000000002e-14Initial program 81.1%
Taylor expanded in t around 0 95.6%
if -5.0000000000000002e-14 < (/.f64 x y) < 5.00000000000000041e-6Initial program 86.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Simplified99.5%
if 5.00000000000000041e-6 < (/.f64 x y) Initial program 87.5%
Taylor expanded in t around 0 96.6%
Taylor expanded in z around 0 98.0%
*-commutative98.0%
associate-*r/98.0%
metadata-eval98.0%
*-commutative98.0%
associate-/l/98.0%
*-rgt-identity98.0%
associate-*r/97.9%
metadata-eval97.9%
associate-*l/97.9%
associate-*l*97.9%
associate-*r/97.9%
metadata-eval97.9%
distribute-lft-in97.9%
associate-*l/97.9%
*-lft-identity97.9%
Simplified97.9%
Final simplification98.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -43.0) (not (<= (/ x y) 1.45e+87))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -43.0) || !((x / y) <= 1.45e+87)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / 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) :: tmp
if (((x / y) <= (-43.0d0)) .or. (.not. ((x / y) <= 1.45d+87))) then
tmp = (x / y) + (2.0d0 / t)
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -43.0) || !((x / y) <= 1.45e+87)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -43.0) or not ((x / y) <= 1.45e+87): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -43.0) || !(Float64(x / y) <= 1.45e+87)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -43.0) || ~(((x / y) <= 1.45e+87))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -43.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.45e+87]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -43 \lor \neg \left(\frac{x}{y} \leq 1.45 \cdot 10^{+87}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -43 or 1.4499999999999999e87 < (/.f64 x y) Initial program 82.6%
Taylor expanded in t around 0 95.7%
associate-/r*88.3%
+-commutative88.3%
fma-def88.3%
Simplified88.3%
Taylor expanded in z around inf 82.4%
associate-*r/82.4%
metadata-eval82.4%
+-commutative82.4%
Simplified82.4%
if -43 < (/.f64 x y) < 1.4499999999999999e87Initial program 87.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 97.4%
sub-neg97.4%
associate-*r/97.4%
metadata-eval97.4%
associate-*r/97.4%
metadata-eval97.4%
metadata-eval97.4%
+-commutative97.4%
associate-+r+97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in t around 0 97.4%
sub-neg97.4%
metadata-eval97.4%
+-commutative97.4%
metadata-eval97.4%
*-commutative97.4%
associate-*r/97.4%
associate-/r*97.3%
associate-*r/97.3%
associate-*l/97.3%
*-commutative97.3%
metadata-eval97.3%
associate-*r/97.3%
associate-*r*97.3%
associate-*l/97.3%
metadata-eval97.3%
distribute-rgt-in97.3%
associate-*l/97.3%
*-lft-identity97.3%
Simplified97.3%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1350000000000.0) (not (<= (/ x y) 2200000.0))) (+ (/ x y) (/ (/ 2.0 t) z)) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1350000000000.0) || !((x / y) <= 2200000.0)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / 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) :: tmp
if (((x / y) <= (-1350000000000.0d0)) .or. (.not. ((x / y) <= 2200000.0d0))) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1350000000000.0) || !((x / y) <= 2200000.0)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1350000000000.0) or not ((x / y) <= 2200000.0): tmp = (x / y) + ((2.0 / t) / z) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1350000000000.0) || !(Float64(x / y) <= 2200000.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1350000000000.0) || ~(((x / y) <= 2200000.0))) tmp = (x / y) + ((2.0 / t) / z); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1350000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2200000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1350000000000 \lor \neg \left(\frac{x}{y} \leq 2200000\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.35e12 or 2.2e6 < (/.f64 x y) Initial program 82.9%
Taylor expanded in z around 0 90.3%
associate-/r*90.3%
Simplified90.3%
if -1.35e12 < (/.f64 x y) < 2.2e6Initial program 87.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-+r+98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in t around 0 98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
metadata-eval98.7%
*-commutative98.7%
associate-*r/98.7%
associate-/r*98.7%
associate-*r/98.7%
associate-*l/98.6%
*-commutative98.6%
metadata-eval98.6%
associate-*r/98.6%
associate-*r*98.6%
associate-*l/98.6%
metadata-eval98.6%
distribute-rgt-in98.6%
associate-*l/98.6%
*-lft-identity98.6%
Simplified98.6%
Final simplification94.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= z -1.65e-39)
t_1
(if (<= z 1.8e-108)
(/ 2.0 (* t z))
(if (<= z 4800000.0) (- (/ x y) 2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -1.65e-39) {
tmp = t_1;
} else if (z <= 1.8e-108) {
tmp = 2.0 / (t * z);
} else if (z <= 4800000.0) {
tmp = (x / y) - 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 = (x / y) + (2.0d0 / t)
if (z <= (-1.65d-39)) then
tmp = t_1
else if (z <= 1.8d-108) then
tmp = 2.0d0 / (t * z)
else if (z <= 4800000.0d0) then
tmp = (x / y) - 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 = (x / y) + (2.0 / t);
double tmp;
if (z <= -1.65e-39) {
tmp = t_1;
} else if (z <= 1.8e-108) {
tmp = 2.0 / (t * z);
} else if (z <= 4800000.0) {
tmp = (x / y) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if z <= -1.65e-39: tmp = t_1 elif z <= 1.8e-108: tmp = 2.0 / (t * z) elif z <= 4800000.0: tmp = (x / y) - 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -1.65e-39) tmp = t_1; elseif (z <= 1.8e-108) tmp = Float64(2.0 / Float64(t * z)); elseif (z <= 4800000.0) tmp = Float64(Float64(x / y) - 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -1.65e-39) tmp = t_1; elseif (z <= 1.8e-108) tmp = 2.0 / (t * z); elseif (z <= 4800000.0) tmp = (x / y) - 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e-39], t$95$1, If[LessEqual[z, 1.8e-108], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4800000.0], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 4800000:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.64999999999999992e-39 or 4.8e6 < z Initial program 69.8%
Taylor expanded in t around 0 77.0%
associate-/r*56.8%
+-commutative56.8%
fma-def56.8%
Simplified56.8%
Taylor expanded in z around inf 73.8%
associate-*r/73.8%
metadata-eval73.8%
+-commutative73.8%
Simplified73.8%
if -1.64999999999999992e-39 < z < 1.8e-108Initial program 97.4%
Taylor expanded in t around 0 97.4%
associate--l+97.4%
associate-*r/97.4%
metadata-eval97.4%
associate-/r*97.4%
Simplified97.4%
Taylor expanded in z around 0 67.6%
if 1.8e-108 < z < 4.8e6Initial program 99.8%
Taylor expanded in t around inf 79.1%
Final simplification71.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -104000000000.0) (not (<= (/ x y) 260000000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -104000000000.0) || !((x / y) <= 260000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.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 / y) <= (-104000000000.0d0)) .or. (.not. ((x / y) <= 260000000.0d0))) then
tmp = x / y
else
tmp = (2.0d0 / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -104000000000.0) || !((x / y) <= 260000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -104000000000.0) or not ((x / y) <= 260000000.0): tmp = x / y else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -104000000000.0) || !(Float64(x / y) <= 260000000.0)) tmp = Float64(x / y); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -104000000000.0) || ~(((x / y) <= 260000000.0))) tmp = x / y; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -104000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 260000000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -104000000000 \lor \neg \left(\frac{x}{y} \leq 260000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.04e11 or 2.6e8 < (/.f64 x y) Initial program 82.9%
Taylor expanded in x around inf 73.1%
if -1.04e11 < (/.f64 x y) < 2.6e8Initial program 87.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-+r+98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in z around inf 54.8%
sub-neg54.8%
associate-*r/54.8%
metadata-eval54.8%
metadata-eval54.8%
Simplified54.8%
Final simplification63.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -380000000000.0) (not (<= (/ x y) 7800000.0))) (- (/ x y) 2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -380000000000.0) || !((x / y) <= 7800000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -2.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 / y) <= (-380000000000.0d0)) .or. (.not. ((x / y) <= 7800000.0d0))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -380000000000.0) || !((x / y) <= 7800000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -380000000000.0) or not ((x / y) <= 7800000.0): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -380000000000.0) || !(Float64(x / y) <= 7800000.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -380000000000.0) || ~(((x / y) <= 7800000.0))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -380000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 7800000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -380000000000 \lor \neg \left(\frac{x}{y} \leq 7800000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.8e11 or 7.8e6 < (/.f64 x y) Initial program 82.9%
Taylor expanded in t around inf 73.5%
if -3.8e11 < (/.f64 x y) < 7.8e6Initial program 87.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-+r+98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in z around inf 54.8%
sub-neg54.8%
associate-*r/54.8%
metadata-eval54.8%
metadata-eval54.8%
Simplified54.8%
Final simplification63.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.5e-12) (not (<= t 10000000000000.0))) (- (/ x y) 2.0) (* 2.0 (/ (+ z 1.0) (* t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e-12) || !(t <= 10000000000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 * ((z + 1.0) / (t * z));
}
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 ((t <= (-3.5d-12)) .or. (.not. (t <= 10000000000000.0d0))) then
tmp = (x / y) - 2.0d0
else
tmp = 2.0d0 * ((z + 1.0d0) / (t * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e-12) || !(t <= 10000000000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 * ((z + 1.0) / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.5e-12) or not (t <= 10000000000000.0): tmp = (x / y) - 2.0 else: tmp = 2.0 * ((z + 1.0) / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.5e-12) || !(t <= 10000000000000.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 * Float64(Float64(z + 1.0) / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.5e-12) || ~((t <= 10000000000000.0))) tmp = (x / y) - 2.0; else tmp = 2.0 * ((z + 1.0) / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.5e-12], N[Not[LessEqual[t, 10000000000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 * N[(N[(z + 1.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-12} \lor \neg \left(t \leq 10000000000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{z + 1}{t \cdot z}\\
\end{array}
\end{array}
if t < -3.5e-12 or 1e13 < t Initial program 74.1%
Taylor expanded in t around inf 83.2%
if -3.5e-12 < t < 1e13Initial program 96.7%
+-commutative96.7%
remove-double-neg96.7%
distribute-frac-neg96.7%
unsub-neg96.7%
*-commutative96.7%
associate-*r*96.7%
distribute-rgt1-in96.7%
associate-*r/97.4%
/-rgt-identity97.4%
fma-neg97.4%
/-rgt-identity97.4%
*-commutative97.4%
fma-def97.4%
*-commutative97.4%
distribute-frac-neg97.4%
remove-double-neg97.4%
Simplified97.4%
Taylor expanded in t around 0 83.9%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.4e-12) (not (<= t 10000000000000.0))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.4e-12) || !(t <= 10000000000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / 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) :: tmp
if ((t <= (-2.4d-12)) .or. (.not. (t <= 10000000000000.0d0))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.4e-12) || !(t <= 10000000000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.4e-12) or not (t <= 10000000000000.0): tmp = (x / y) - 2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.4e-12) || !(t <= 10000000000000.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.4e-12) || ~((t <= 10000000000000.0))) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.4e-12], N[Not[LessEqual[t, 10000000000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-12} \lor \neg \left(t \leq 10000000000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -2.39999999999999987e-12 or 1e13 < t Initial program 74.1%
Taylor expanded in t around inf 83.2%
if -2.39999999999999987e-12 < t < 1e13Initial program 96.7%
Taylor expanded in t around 0 83.9%
associate-*r/83.9%
metadata-eval83.9%
Simplified83.9%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 8e+46) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 8e+46) {
tmp = 2.0 / t;
} else {
tmp = -2.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 (t <= (-1.0d0)) then
tmp = -2.0d0
else if (t <= 8d+46) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 8e+46) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 8e+46: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 8e+46) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.0) tmp = -2.0; elseif (t <= 8e+46) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 8e+46], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 7.9999999999999999e46 < t Initial program 72.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 50.3%
sub-neg50.3%
associate-*r/50.3%
metadata-eval50.3%
associate-*r/50.3%
metadata-eval50.3%
metadata-eval50.3%
+-commutative50.3%
associate-+r+50.3%
+-commutative50.3%
Simplified50.3%
Taylor expanded in t around inf 35.9%
if -1 < t < 7.9999999999999999e46Initial program 96.9%
Taylor expanded in z around inf 50.1%
associate-*r/50.1%
Simplified50.1%
Taylor expanded in t around 0 29.2%
Final simplification32.4%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.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 = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 85.1%
Taylor expanded in t around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-/r*98.8%
Simplified98.8%
Taylor expanded in x around 0 66.4%
sub-neg66.4%
associate-*r/66.4%
metadata-eval66.4%
associate-*r/66.4%
metadata-eval66.4%
metadata-eval66.4%
+-commutative66.4%
associate-+r+66.4%
+-commutative66.4%
Simplified66.4%
Taylor expanded in t around inf 18.3%
Final simplification18.3%
(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 2024020
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))