
(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(2.0 / Float64(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[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2}{t \cdot z} + \left(\frac{2}{t} + -2\right)\right)
\end{array}
Initial program 86.6%
Taylor expanded in t around inf 98.7%
sub-neg98.7%
metadata-eval98.7%
associate-*r/98.7%
+-commutative98.7%
metadata-eval98.7%
associate-+l+98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z)))
(t_2 (+ (/ x y) (/ 2.0 t)))
(t_3 (- (/ x y) 2.0)))
(if (<= t -5.5e-35)
t_3
(if (<= t -2.8e-67)
t_1
(if (<= t -5.4e-299)
t_2
(if (<= t 2.5e-199) t_1 (if (<= t 0.205) t_2 t_3)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double t_2 = (x / y) + (2.0 / t);
double t_3 = (x / y) - 2.0;
double tmp;
if (t <= -5.5e-35) {
tmp = t_3;
} else if (t <= -2.8e-67) {
tmp = t_1;
} else if (t <= -5.4e-299) {
tmp = t_2;
} else if (t <= 2.5e-199) {
tmp = t_1;
} else if (t <= 0.205) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = 2.0d0 / (t * z)
t_2 = (x / y) + (2.0d0 / t)
t_3 = (x / y) - 2.0d0
if (t <= (-5.5d-35)) then
tmp = t_3
else if (t <= (-2.8d-67)) then
tmp = t_1
else if (t <= (-5.4d-299)) then
tmp = t_2
else if (t <= 2.5d-199) then
tmp = t_1
else if (t <= 0.205d0) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double t_2 = (x / y) + (2.0 / t);
double t_3 = (x / y) - 2.0;
double tmp;
if (t <= -5.5e-35) {
tmp = t_3;
} else if (t <= -2.8e-67) {
tmp = t_1;
} else if (t <= -5.4e-299) {
tmp = t_2;
} else if (t <= 2.5e-199) {
tmp = t_1;
} else if (t <= 0.205) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (t * z) t_2 = (x / y) + (2.0 / t) t_3 = (x / y) - 2.0 tmp = 0 if t <= -5.5e-35: tmp = t_3 elif t <= -2.8e-67: tmp = t_1 elif t <= -5.4e-299: tmp = t_2 elif t <= 2.5e-199: tmp = t_1 elif t <= 0.205: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(t * z)) t_2 = Float64(Float64(x / y) + Float64(2.0 / t)) t_3 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -5.5e-35) tmp = t_3; elseif (t <= -2.8e-67) tmp = t_1; elseif (t <= -5.4e-299) tmp = t_2; elseif (t <= 2.5e-199) tmp = t_1; elseif (t <= 0.205) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (t * z); t_2 = (x / y) + (2.0 / t); t_3 = (x / y) - 2.0; tmp = 0.0; if (t <= -5.5e-35) tmp = t_3; elseif (t <= -2.8e-67) tmp = t_1; elseif (t <= -5.4e-299) tmp = t_2; elseif (t <= 2.5e-199) tmp = t_1; elseif (t <= 0.205) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -5.5e-35], t$95$3, If[LessEqual[t, -2.8e-67], t$95$1, If[LessEqual[t, -5.4e-299], t$95$2, If[LessEqual[t, 2.5e-199], t$95$1, If[LessEqual[t, 0.205], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
t_2 := \frac{x}{y} + \frac{2}{t}\\
t_3 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-35}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-299}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 0.205:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if t < -5.4999999999999997e-35 or 0.204999999999999988 < t Initial program 76.8%
Taylor expanded in t around inf 83.5%
if -5.4999999999999997e-35 < t < -2.8000000000000001e-67 or -5.40000000000000004e-299 < t < 2.4999999999999998e-199Initial program 91.8%
Taylor expanded in z around 0 81.3%
if -2.8000000000000001e-67 < t < -5.40000000000000004e-299 or 2.4999999999999998e-199 < t < 0.204999999999999988Initial program 98.7%
Taylor expanded in z around inf 67.4%
associate-*r/67.4%
Simplified67.4%
Taylor expanded in t around 0 66.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -4.8e-32)
t_1
(if (<= t 1.1e-151)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 5e+55) (+ (/ x y) (/ (/ 2.0 t) z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -4.8e-32) {
tmp = t_1;
} else if (t <= 1.1e-151) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 5e+55) {
tmp = (x / y) + ((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 = (x / y) - 2.0d0
if (t <= (-4.8d-32)) then
tmp = t_1
else if (t <= 1.1d-151) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 5d+55) then
tmp = (x / y) + ((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 = (x / y) - 2.0;
double tmp;
if (t <= -4.8e-32) {
tmp = t_1;
} else if (t <= 1.1e-151) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 5e+55) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -4.8e-32: tmp = t_1 elif t <= 1.1e-151: tmp = (2.0 + (2.0 / z)) / t elif t <= 5e+55: tmp = (x / y) + ((2.0 / t) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -4.8e-32) tmp = t_1; elseif (t <= 1.1e-151) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 5e+55) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -4.8e-32) tmp = t_1; elseif (t <= 1.1e-151) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 5e+55) tmp = (x / y) + ((2.0 / t) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -4.8e-32], t$95$1, If[LessEqual[t, 1.1e-151], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 5e+55], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-151}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+55}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.8000000000000003e-32 or 5.00000000000000046e55 < t Initial program 75.1%
Taylor expanded in t around inf 86.2%
if -4.8000000000000003e-32 < t < 1.1e-151Initial program 97.5%
Taylor expanded in t around 0 90.0%
associate-*r/90.0%
metadata-eval90.0%
Simplified90.0%
if 1.1e-151 < t < 5.00000000000000046e55Initial program 97.4%
Taylor expanded in t around inf 80.6%
*-commutative80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r*80.6%
Simplified80.6%
Taylor expanded in x around 0 80.6%
associate--l+80.6%
associate-*r/80.6%
metadata-eval80.6%
associate-/r*80.6%
sub-neg80.6%
metadata-eval80.6%
Simplified80.6%
Taylor expanded in x around inf 79.1%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.4e+24) (not (<= t 1.0))) (+ (/ (/ 2.0 t) z) (+ (/ x y) -2.0)) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.4e+24) || !(t <= 1.0)) {
tmp = ((2.0 / t) / z) + ((x / y) + -2.0);
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (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 <= (-9.4d+24)) .or. (.not. (t <= 1.0d0))) then
tmp = ((2.0d0 / t) / z) + ((x / y) + (-2.0d0))
else
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (t * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.4e+24) || !(t <= 1.0)) {
tmp = ((2.0 / t) / z) + ((x / y) + -2.0);
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9.4e+24) or not (t <= 1.0): tmp = ((2.0 / t) / z) + ((x / y) + -2.0) else: tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9.4e+24) || !(t <= 1.0)) tmp = Float64(Float64(Float64(2.0 / t) / z) + Float64(Float64(x / y) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9.4e+24) || ~((t <= 1.0))) tmp = ((2.0 / t) / z) + ((x / y) + -2.0); else tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.4e+24], N[Not[LessEqual[t, 1.0]], $MachinePrecision]], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.4 \cdot 10^{+24} \lor \neg \left(t \leq 1\right):\\
\;\;\;\;\frac{\frac{2}{t}}{z} + \left(\frac{x}{y} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\end{array}
\end{array}
if t < -9.3999999999999999e24 or 1 < t Initial program 74.9%
Taylor expanded in t around inf 74.0%
*-commutative74.0%
*-commutative74.0%
*-commutative74.0%
associate-*r*74.0%
Simplified74.0%
Taylor expanded in x around 0 99.0%
associate--l+99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/r*99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
if -9.3999999999999999e24 < t < 1Initial program 97.5%
Taylor expanded in t around 0 97.2%
Final simplification98.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -102.0) (not (<= z 2.5e-7))) (+ (/ x y) (/ (* 2.0 (- 1.0 t)) t)) (+ (/ (/ 2.0 t) z) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -102.0) || !(z <= 2.5e-7)) {
tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
} else {
tmp = ((2.0 / t) / z) + ((x / y) + -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 ((z <= (-102.0d0)) .or. (.not. (z <= 2.5d-7))) then
tmp = (x / y) + ((2.0d0 * (1.0d0 - t)) / t)
else
tmp = ((2.0d0 / t) / z) + ((x / y) + (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -102.0) || !(z <= 2.5e-7)) {
tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
} else {
tmp = ((2.0 / t) / z) + ((x / y) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -102.0) or not (z <= 2.5e-7): tmp = (x / y) + ((2.0 * (1.0 - t)) / t) else: tmp = ((2.0 / t) / z) + ((x / y) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -102.0) || !(z <= 2.5e-7)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 * Float64(1.0 - t)) / t)); else tmp = Float64(Float64(Float64(2.0 / t) / z) + Float64(Float64(x / y) + -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -102.0) || ~((z <= 2.5e-7))) tmp = (x / y) + ((2.0 * (1.0 - t)) / t); else tmp = ((2.0 / t) / z) + ((x / y) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -102.0], N[Not[LessEqual[z, 2.5e-7]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -102 \lor \neg \left(z \leq 2.5 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 \cdot \left(1 - t\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z} + \left(\frac{x}{y} + -2\right)\\
\end{array}
\end{array}
if z < -102 or 2.49999999999999989e-7 < z Initial program 76.2%
Taylor expanded in z around inf 99.5%
associate-*r/99.5%
Simplified99.5%
if -102 < z < 2.49999999999999989e-7Initial program 97.4%
Taylor expanded in t around inf 96.6%
*-commutative96.6%
*-commutative96.6%
*-commutative96.6%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in x around 0 96.6%
associate--l+96.6%
associate-*r/96.6%
metadata-eval96.6%
associate-/r*96.6%
sub-neg96.6%
metadata-eval96.6%
Simplified96.6%
Final simplification98.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e-21) (not (<= z 1.36e-13))) (+ (/ x y) (/ (* 2.0 (- 1.0 t)) t)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e-21) || !(z <= 1.36e-13)) {
tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
} else {
tmp = (x / y) + ((2.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 ((z <= (-2.9d-21)) .or. (.not. (z <= 1.36d-13))) then
tmp = (x / y) + ((2.0d0 * (1.0d0 - t)) / t)
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e-21) || !(z <= 1.36e-13)) {
tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.9e-21) or not (z <= 1.36e-13): tmp = (x / y) + ((2.0 * (1.0 - t)) / t) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e-21) || !(z <= 1.36e-13)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 * Float64(1.0 - t)) / t)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.9e-21) || ~((z <= 1.36e-13))) tmp = (x / y) + ((2.0 * (1.0 - t)) / t); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e-21], N[Not[LessEqual[z, 1.36e-13]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-21} \lor \neg \left(z \leq 1.36 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 \cdot \left(1 - t\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -2.9e-21 or 1.36000000000000001e-13 < z Initial program 77.1%
Taylor expanded in z around inf 98.0%
associate-*r/98.0%
Simplified98.0%
if -2.9e-21 < z < 1.36000000000000001e-13Initial program 97.3%
Taylor expanded in t around inf 97.3%
*-commutative97.3%
*-commutative97.3%
*-commutative97.3%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 97.3%
associate--l+97.3%
associate-*r/97.3%
metadata-eval97.3%
associate-/r*97.4%
sub-neg97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in x around inf 86.5%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.018) (not (<= (/ x y) 1.1e+30))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.018) || !((x / y) <= 1.1e+30)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.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 (((x / y) <= (-0.018d0)) .or. (.not. ((x / y) <= 1.1d+30))) then
tmp = (x / y) + (2.0d0 / t)
else
tmp = (-2.0d0) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.018) || !((x / y) <= 1.1e+30)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.018) or not ((x / y) <= 1.1e+30): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.018) || !(Float64(x / y) <= 1.1e+30)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -0.018) || ~(((x / y) <= 1.1e+30))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -0.018], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.1e+30]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.018 \lor \neg \left(\frac{x}{y} \leq 1.1 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0179999999999999986 or 1.1e30 < (/.f64 x y) Initial program 85.4%
Taylor expanded in z around inf 83.6%
associate-*r/83.6%
Simplified83.6%
Taylor expanded in t around 0 82.4%
if -0.0179999999999999986 < (/.f64 x y) < 1.1e30Initial program 87.7%
Taylor expanded in t around inf 63.4%
*-commutative63.4%
*-commutative63.4%
*-commutative63.4%
associate-*r*63.4%
Simplified63.4%
Taylor expanded in x around 0 74.2%
sub-neg74.2%
associate-*r/74.2%
metadata-eval74.2%
associate-/r*74.3%
metadata-eval74.3%
Simplified74.3%
Final simplification78.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -9.5e-36)
t_1
(if (<= t 7.5e-198) (/ (/ 2.0 t) z) (if (<= t 3e-159) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -9.5e-36) {
tmp = t_1;
} else if (t <= 7.5e-198) {
tmp = (2.0 / t) / z;
} else if (t <= 3e-159) {
tmp = 2.0 / t;
} 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
if (t <= (-9.5d-36)) then
tmp = t_1
else if (t <= 7.5d-198) then
tmp = (2.0d0 / t) / z
else if (t <= 3d-159) then
tmp = 2.0d0 / t
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;
double tmp;
if (t <= -9.5e-36) {
tmp = t_1;
} else if (t <= 7.5e-198) {
tmp = (2.0 / t) / z;
} else if (t <= 3e-159) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -9.5e-36: tmp = t_1 elif t <= 7.5e-198: tmp = (2.0 / t) / z elif t <= 3e-159: tmp = 2.0 / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -9.5e-36) tmp = t_1; elseif (t <= 7.5e-198) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 3e-159) tmp = Float64(2.0 / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -9.5e-36) tmp = t_1; elseif (t <= 7.5e-198) tmp = (2.0 / t) / z; elseif (t <= 3e-159) tmp = 2.0 / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -9.5e-36], t$95$1, If[LessEqual[t, 7.5e-198], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 3e-159], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-198}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.5000000000000003e-36 or 3.00000000000000009e-159 < t Initial program 81.1%
Taylor expanded in t around inf 75.5%
if -9.5000000000000003e-36 < t < 7.50000000000000064e-198Initial program 97.1%
Taylor expanded in t around inf 97.2%
sub-neg97.2%
metadata-eval97.2%
associate-*r/97.2%
+-commutative97.2%
metadata-eval97.2%
associate-+l+97.2%
associate-*r/97.2%
metadata-eval97.2%
associate-*r/97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in z around 0 53.9%
associate-/r*53.9%
Simplified53.9%
if 7.50000000000000064e-198 < t < 3.00000000000000009e-159Initial program 99.6%
Taylor expanded in z around inf 92.1%
associate-*r/92.1%
Simplified92.1%
Taylor expanded in t around 0 83.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -2.1e-32)
t_1
(if (<= t 6.4e-196) (/ 2.0 (* t z)) (if (<= t 5.3e-160) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -2.1e-32) {
tmp = t_1;
} else if (t <= 6.4e-196) {
tmp = 2.0 / (t * z);
} else if (t <= 5.3e-160) {
tmp = 2.0 / t;
} 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
if (t <= (-2.1d-32)) then
tmp = t_1
else if (t <= 6.4d-196) then
tmp = 2.0d0 / (t * z)
else if (t <= 5.3d-160) then
tmp = 2.0d0 / t
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;
double tmp;
if (t <= -2.1e-32) {
tmp = t_1;
} else if (t <= 6.4e-196) {
tmp = 2.0 / (t * z);
} else if (t <= 5.3e-160) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -2.1e-32: tmp = t_1 elif t <= 6.4e-196: tmp = 2.0 / (t * z) elif t <= 5.3e-160: tmp = 2.0 / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -2.1e-32) tmp = t_1; elseif (t <= 6.4e-196) tmp = Float64(2.0 / Float64(t * z)); elseif (t <= 5.3e-160) tmp = Float64(2.0 / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -2.1e-32) tmp = t_1; elseif (t <= 6.4e-196) tmp = 2.0 / (t * z); elseif (t <= 5.3e-160) tmp = 2.0 / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -2.1e-32], t$95$1, If[LessEqual[t, 6.4e-196], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.3e-160], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-196}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;t \leq 5.3 \cdot 10^{-160}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.0999999999999999e-32 or 5.3000000000000001e-160 < t Initial program 81.1%
Taylor expanded in t around inf 75.5%
if -2.0999999999999999e-32 < t < 6.3999999999999999e-196Initial program 97.1%
Taylor expanded in z around 0 53.9%
if 6.3999999999999999e-196 < t < 5.3000000000000001e-160Initial program 99.6%
Taylor expanded in z around inf 92.1%
associate-*r/92.1%
Simplified92.1%
Taylor expanded in t around 0 83.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -9.5) (not (<= (/ x y) 9.8e+39))) (- (/ x y) 2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -9.5) || !((x / y) <= 9.8e+39)) {
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) <= (-9.5d0)) .or. (.not. ((x / y) <= 9.8d+39))) 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) <= -9.5) || !((x / y) <= 9.8e+39)) {
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) <= -9.5) or not ((x / y) <= 9.8e+39): 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) <= -9.5) || !(Float64(x / y) <= 9.8e+39)) 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) <= -9.5) || ~(((x / y) <= 9.8e+39))) 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], -9.5], N[Not[LessEqual[N[(x / y), $MachinePrecision], 9.8e+39]], $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 -9.5 \lor \neg \left(\frac{x}{y} \leq 9.8 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5 or 9.79999999999999974e39 < (/.f64 x y) Initial program 85.0%
Taylor expanded in t around inf 74.8%
if -9.5 < (/.f64 x y) < 9.79999999999999974e39Initial program 87.9%
Taylor expanded in z around inf 61.8%
associate-*r/61.8%
Simplified61.8%
Taylor expanded in x around 0 59.8%
Taylor expanded in t around inf 59.8%
sub-neg59.8%
associate-*r/59.8%
metadata-eval59.8%
metadata-eval59.8%
Simplified59.8%
Final simplification66.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -100000.0) (not (<= (/ x y) 9.8e+39))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -100000.0) || !((x / y) <= 9.8e+39)) {
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) <= (-100000.0d0)) .or. (.not. ((x / y) <= 9.8d+39))) 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) <= -100000.0) || !((x / y) <= 9.8e+39)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -100000.0) or not ((x / y) <= 9.8e+39): 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) <= -100000.0) || !(Float64(x / y) <= 9.8e+39)) 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) <= -100000.0) || ~(((x / y) <= 9.8e+39))) 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], -100000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 9.8e+39]], $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 -100000 \lor \neg \left(\frac{x}{y} \leq 9.8 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1e5 or 9.79999999999999974e39 < (/.f64 x y) Initial program 85.0%
Taylor expanded in x around inf 73.6%
if -1e5 < (/.f64 x y) < 9.79999999999999974e39Initial program 87.9%
Taylor expanded in z around inf 61.8%
associate-*r/61.8%
Simplified61.8%
Taylor expanded in x around 0 59.8%
Taylor expanded in t around inf 59.8%
sub-neg59.8%
associate-*r/59.8%
metadata-eval59.8%
metadata-eval59.8%
Simplified59.8%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.4e-32) (not (<= t 2.9e-78))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.4e-32) || !(t <= 2.9e-78)) {
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 <= (-4.4d-32)) .or. (.not. (t <= 2.9d-78))) 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 <= -4.4e-32) || !(t <= 2.9e-78)) {
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 <= -4.4e-32) or not (t <= 2.9e-78): 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 <= -4.4e-32) || !(t <= 2.9e-78)) 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 <= -4.4e-32) || ~((t <= 2.9e-78))) 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, -4.4e-32], N[Not[LessEqual[t, 2.9e-78]], $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 -4.4 \cdot 10^{-32} \lor \neg \left(t \leq 2.9 \cdot 10^{-78}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -4.4e-32 or 2.9000000000000001e-78 < t Initial program 78.9%
Taylor expanded in t around inf 81.1%
if -4.4e-32 < t < 2.9000000000000001e-78Initial program 97.0%
Taylor expanded in t around 0 85.5%
associate-*r/85.5%
metadata-eval85.5%
Simplified85.5%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.085) (not (<= (/ x y) 0.000135))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.085) || !((x / y) <= 0.000135)) {
tmp = x / y;
} 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 (((x / y) <= (-0.085d0)) .or. (.not. ((x / y) <= 0.000135d0))) then
tmp = x / y
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 (((x / y) <= -0.085) || !((x / y) <= 0.000135)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.085) or not ((x / y) <= 0.000135): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.085) || !(Float64(x / y) <= 0.000135)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -0.085) || ~(((x / y) <= 0.000135))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -0.085], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.000135]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.085 \lor \neg \left(\frac{x}{y} \leq 0.000135\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0850000000000000061 or 1.35000000000000002e-4 < (/.f64 x y) Initial program 86.1%
Taylor expanded in x around inf 68.9%
if -0.0850000000000000061 < (/.f64 x y) < 1.35000000000000002e-4Initial program 87.0%
Taylor expanded in t around inf 39.5%
Taylor expanded in x around 0 38.1%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (if (<= t -3.45e-9) -2.0 (if (<= t 0.205) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.45e-9) {
tmp = -2.0;
} else if (t <= 0.205) {
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 <= (-3.45d-9)) then
tmp = -2.0d0
else if (t <= 0.205d0) 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 <= -3.45e-9) {
tmp = -2.0;
} else if (t <= 0.205) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.45e-9: tmp = -2.0 elif t <= 0.205: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.45e-9) tmp = -2.0; elseif (t <= 0.205) 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 <= -3.45e-9) tmp = -2.0; elseif (t <= 0.205) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.45e-9], -2.0, If[LessEqual[t, 0.205], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.45 \cdot 10^{-9}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 0.205:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -3.44999999999999987e-9 or 0.204999999999999988 < t Initial program 76.2%
Taylor expanded in t around inf 83.8%
Taylor expanded in x around 0 36.8%
if -3.44999999999999987e-9 < t < 0.204999999999999988Initial program 97.4%
Taylor expanded in z around inf 58.5%
associate-*r/58.5%
Simplified58.5%
Taylor expanded in t around 0 35.5%
(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 86.6%
Taylor expanded in t around inf 55.1%
Taylor expanded in x around 0 20.0%
(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 2024185
(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))))