
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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 = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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 = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= y -1.6e-91)
(+ x (* (/ 0.3333333333333333 z) (- (/ t y) y)))
(if (<= y 2.9e-63)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(+ x (* (/ 0.3333333333333333 z) (- (/ 1.0 (/ y t)) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-91) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else if (y <= 2.9e-63) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - 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 (y <= (-1.6d-91)) then
tmp = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
else if (y <= 2.9d-63) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
else
tmp = x + ((0.3333333333333333d0 / z) * ((1.0d0 / (y / t)) - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-91) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else if (y <= 2.9e-63) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e-91: tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)) elif y <= 2.9e-63: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e-91) tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); elseif (y <= 2.9e-63) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(1.0 / Float64(y / t)) - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.6e-91) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); elseif (y <= 2.9e-63) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e-91], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-63], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(1.0 / N[(y / t), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-91}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-63}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{1}{\frac{y}{t}} - y\right)\\
\end{array}
\end{array}
if y < -1.59999999999999998e-91Initial program 94.6%
sub-neg94.6%
associate-+l+94.6%
+-commutative94.6%
remove-double-neg94.6%
distribute-frac-neg94.6%
distribute-neg-in94.6%
remove-double-neg94.6%
sub-neg94.6%
neg-mul-194.6%
times-frac96.7%
distribute-frac-neg96.7%
neg-mul-196.7%
*-commutative96.7%
associate-/l*96.6%
*-commutative96.6%
Simplified99.8%
if -1.59999999999999998e-91 < y < 2.89999999999999975e-63Initial program 90.9%
sub-neg90.9%
associate-+l+90.9%
+-commutative90.9%
remove-double-neg90.9%
distribute-frac-neg90.9%
distribute-neg-in90.9%
remove-double-neg90.9%
sub-neg90.9%
neg-mul-190.9%
times-frac88.6%
distribute-frac-neg88.6%
neg-mul-188.6%
*-commutative88.6%
associate-/l*88.6%
*-commutative88.6%
Simplified88.5%
clear-num88.5%
inv-pow88.5%
Applied egg-rr88.5%
unpow-188.5%
Simplified88.5%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
associate-/r*99.8%
Simplified99.8%
if 2.89999999999999975e-63 < y Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
+-commutative98.5%
remove-double-neg98.5%
distribute-frac-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
sub-neg98.5%
neg-mul-198.5%
times-frac98.5%
distribute-frac-neg98.5%
neg-mul-198.5%
*-commutative98.5%
associate-/l*98.4%
*-commutative98.4%
Simplified99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -9.5e+67)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y -7e-15)
(/ (* 0.3333333333333333 (- (/ t y) y)) z)
(if (<= y 6.4e+74)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(- x (/ (* y 0.3333333333333333) z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+67) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= -7e-15) {
tmp = (0.3333333333333333 * ((t / y) - y)) / z;
} else if (y <= 6.4e+74) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x - ((y * 0.3333333333333333) / 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 (y <= (-9.5d+67)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= (-7d-15)) then
tmp = (0.3333333333333333d0 * ((t / y) - y)) / z
else if (y <= 6.4d+74) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
else
tmp = x - ((y * 0.3333333333333333d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+67) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= -7e-15) {
tmp = (0.3333333333333333 * ((t / y) - y)) / z;
} else if (y <= 6.4e+74) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x - ((y * 0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.5e+67: tmp = x - (0.3333333333333333 * (y / z)) elif y <= -7e-15: tmp = (0.3333333333333333 * ((t / y) - y)) / z elif y <= 6.4e+74: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x - ((y * 0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e+67) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= -7e-15) tmp = Float64(Float64(0.3333333333333333 * Float64(Float64(t / y) - y)) / z); elseif (y <= 6.4e+74) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); else tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9.5e+67) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= -7e-15) tmp = (0.3333333333333333 * ((t / y) - y)) / z; elseif (y <= 6.4e+74) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x - ((y * 0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e+67], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7e-15], N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 6.4e+74], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+67}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-15}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+74}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -9.5000000000000002e67Initial program 94.5%
Taylor expanded in t around 0 94.6%
if -9.5000000000000002e67 < y < -7.0000000000000001e-15Initial program 95.8%
Taylor expanded in z around 0 87.9%
distribute-lft-out--87.9%
*-commutative87.9%
Applied egg-rr87.9%
if -7.0000000000000001e-15 < y < 6.39999999999999989e74Initial program 92.4%
sub-neg92.4%
associate-+l+92.4%
+-commutative92.4%
remove-double-neg92.4%
distribute-frac-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
sub-neg92.4%
neg-mul-192.4%
times-frac91.6%
distribute-frac-neg91.6%
neg-mul-191.6%
*-commutative91.6%
associate-/l*91.6%
*-commutative91.6%
Simplified92.4%
clear-num92.4%
inv-pow92.4%
Applied egg-rr92.4%
unpow-192.4%
Simplified92.4%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
associate-/r*96.8%
Simplified96.8%
if 6.39999999999999989e74 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.8%
Taylor expanded in t around 0 95.9%
neg-mul-195.9%
Simplified95.9%
associate-*l/96.0%
frac-2neg96.0%
add-sqr-sqrt0.0%
sqrt-unprod13.5%
sqr-neg13.5%
sqrt-unprod28.1%
add-sqr-sqrt28.1%
distribute-rgt-neg-out28.1%
add-sqr-sqrt0.0%
sqrt-unprod59.7%
sqr-neg59.7%
sqrt-unprod95.7%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5e-92) (not (<= y 2.9e-63))) (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))) (+ x (* 0.3333333333333333 (/ (/ t z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-92) || !(y <= 2.9e-63)) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = x + (0.3333333333333333 * ((t / z) / 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 ((y <= (-5d-92)) .or. (.not. (y <= 2.9d-63))) then
tmp = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
else
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-92) || !(y <= 2.9e-63)) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = x + (0.3333333333333333 * ((t / z) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5e-92) or not (y <= 2.9e-63): tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)) else: tmp = x + (0.3333333333333333 * ((t / z) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5e-92) || !(y <= 2.9e-63)) tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); else tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5e-92) || ~((y <= 2.9e-63))) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); else tmp = x + (0.3333333333333333 * ((t / z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5e-92], N[Not[LessEqual[y, 2.9e-63]], $MachinePrecision]], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-92} \lor \neg \left(y \leq 2.9 \cdot 10^{-63}\right):\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\end{array}
\end{array}
if y < -5.00000000000000011e-92 or 2.89999999999999975e-63 < y Initial program 96.3%
sub-neg96.3%
associate-+l+96.3%
+-commutative96.3%
remove-double-neg96.3%
distribute-frac-neg96.3%
distribute-neg-in96.3%
remove-double-neg96.3%
sub-neg96.3%
neg-mul-196.3%
times-frac97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.4%
*-commutative97.4%
Simplified99.8%
if -5.00000000000000011e-92 < y < 2.89999999999999975e-63Initial program 90.9%
sub-neg90.9%
associate-+l+90.9%
+-commutative90.9%
remove-double-neg90.9%
distribute-frac-neg90.9%
distribute-neg-in90.9%
remove-double-neg90.9%
sub-neg90.9%
neg-mul-190.9%
times-frac88.6%
distribute-frac-neg88.6%
neg-mul-188.6%
*-commutative88.6%
associate-/l*88.6%
*-commutative88.6%
Simplified88.5%
clear-num88.5%
inv-pow88.5%
Applied egg-rr88.5%
unpow-188.5%
Simplified88.5%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
associate-/r*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.4e-17)
(* (/ y z) -0.3333333333333333)
(if (<= y 5.4e+17)
(* 0.3333333333333333 (/ t (* z y)))
(if (<= y 2.6e+101) (* y (/ x y)) (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-17) {
tmp = (y / z) * -0.3333333333333333;
} else if (y <= 5.4e+17) {
tmp = 0.3333333333333333 * (t / (z * y));
} else if (y <= 2.6e+101) {
tmp = y * (x / y);
} else {
tmp = (y * -0.3333333333333333) / 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 (y <= (-1.4d-17)) then
tmp = (y / z) * (-0.3333333333333333d0)
else if (y <= 5.4d+17) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else if (y <= 2.6d+101) then
tmp = y * (x / y)
else
tmp = (y * (-0.3333333333333333d0)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-17) {
tmp = (y / z) * -0.3333333333333333;
} else if (y <= 5.4e+17) {
tmp = 0.3333333333333333 * (t / (z * y));
} else if (y <= 2.6e+101) {
tmp = y * (x / y);
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e-17: tmp = (y / z) * -0.3333333333333333 elif y <= 5.4e+17: tmp = 0.3333333333333333 * (t / (z * y)) elif y <= 2.6e+101: tmp = y * (x / y) else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e-17) tmp = Float64(Float64(y / z) * -0.3333333333333333); elseif (y <= 5.4e+17) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); elseif (y <= 2.6e+101) tmp = Float64(y * Float64(x / y)); else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.4e-17) tmp = (y / z) * -0.3333333333333333; elseif (y <= 5.4e+17) tmp = 0.3333333333333333 * (t / (z * y)); elseif (y <= 2.6e+101) tmp = y * (x / y); else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-17], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], If[LessEqual[y, 5.4e+17], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+101], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+17}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+101}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.3999999999999999e-17Initial program 94.9%
Taylor expanded in z around 0 76.4%
Taylor expanded in t around 0 60.9%
if -1.3999999999999999e-17 < y < 5.4e17Initial program 92.4%
Taylor expanded in z around 0 66.9%
Taylor expanded in t around inf 66.1%
if 5.4e17 < y < 2.6e101Initial program 95.2%
sub-neg95.2%
associate-+l+95.2%
distribute-frac-neg95.2%
neg-mul-195.2%
*-commutative95.2%
times-frac95.3%
fma-define95.3%
metadata-eval95.3%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in y around inf 69.7%
Taylor expanded in x around inf 60.4%
if 2.6e101 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
times-frac99.8%
fma-define99.8%
metadata-eval99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 99.6%
Taylor expanded in x around 0 79.8%
associate-*r/79.9%
Applied egg-rr79.9%
Final simplification66.1%
(FPCore (x y z t) :precision binary64 (if (<= t -5e+54) (+ (+ (/ t (* z (* y 3.0))) x) (/ y (* z -3.0))) (+ x (* (/ 0.3333333333333333 z) (- (/ 1.0 (/ y t)) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5e+54) {
tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0));
} else {
tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - 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 (t <= (-5d+54)) then
tmp = ((t / (z * (y * 3.0d0))) + x) + (y / (z * (-3.0d0)))
else
tmp = x + ((0.3333333333333333d0 / z) * ((1.0d0 / (y / t)) - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5e+54) {
tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0));
} else {
tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5e+54: tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0)) else: tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5e+54) tmp = Float64(Float64(Float64(t / Float64(z * Float64(y * 3.0))) + x) + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(1.0 / Float64(y / t)) - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5e+54) tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0)); else tmp = x + ((0.3333333333333333 / z) * ((1.0 / (y / t)) - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5e+54], N[(N[(N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(1.0 / N[(y / t), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+54}:\\
\;\;\;\;\left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{1}{\frac{y}{t}} - y\right)\\
\end{array}
\end{array}
if t < -5.00000000000000005e54Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
sub-neg98.2%
associate-*l*98.2%
*-commutative98.2%
distribute-frac-neg298.2%
distribute-rgt-neg-in98.2%
metadata-eval98.2%
Simplified98.2%
if -5.00000000000000005e54 < t Initial program 93.4%
sub-neg93.4%
associate-+l+93.4%
+-commutative93.4%
remove-double-neg93.4%
distribute-frac-neg93.4%
distribute-neg-in93.4%
remove-double-neg93.4%
sub-neg93.4%
neg-mul-193.4%
times-frac96.3%
distribute-frac-neg96.3%
neg-mul-196.3%
*-commutative96.3%
associate-/l*96.3%
*-commutative96.3%
Simplified98.3%
clear-num98.3%
inv-pow98.3%
Applied egg-rr98.3%
unpow-198.3%
Simplified98.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.75e-14)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y 6.4e+74)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(- x (/ (* y 0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.75e-14) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 6.4e+74) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x - ((y * 0.3333333333333333) / 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 (y <= (-1.75d-14)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= 6.4d+74) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
else
tmp = x - ((y * 0.3333333333333333d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.75e-14) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 6.4e+74) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x - ((y * 0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.75e-14: tmp = x - (0.3333333333333333 * (y / z)) elif y <= 6.4e+74: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x - ((y * 0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.75e-14) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= 6.4e+74) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); else tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.75e-14) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= 6.4e+74) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x - ((y * 0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.75e-14], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+74], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-14}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+74}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.7500000000000001e-14Initial program 94.9%
Taylor expanded in t around 0 84.5%
if -1.7500000000000001e-14 < y < 6.39999999999999989e74Initial program 92.4%
sub-neg92.4%
associate-+l+92.4%
+-commutative92.4%
remove-double-neg92.4%
distribute-frac-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
sub-neg92.4%
neg-mul-192.4%
times-frac91.6%
distribute-frac-neg91.6%
neg-mul-191.6%
*-commutative91.6%
associate-/l*91.6%
*-commutative91.6%
Simplified92.4%
clear-num92.4%
inv-pow92.4%
Applied egg-rr92.4%
unpow-192.4%
Simplified92.4%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
associate-/r*96.8%
Simplified96.8%
if 6.39999999999999989e74 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.8%
Taylor expanded in t around 0 95.9%
neg-mul-195.9%
Simplified95.9%
associate-*l/96.0%
frac-2neg96.0%
add-sqr-sqrt0.0%
sqrt-unprod13.5%
sqr-neg13.5%
sqrt-unprod28.1%
add-sqr-sqrt28.1%
distribute-rgt-neg-out28.1%
add-sqr-sqrt0.0%
sqrt-unprod59.7%
sqr-neg59.7%
sqrt-unprod95.7%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
Final simplification92.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.35e-17)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y 5.5e+85)
(+ x (* 0.3333333333333333 (/ t (* z y))))
(- x (/ (* y 0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.35e-17) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 5.5e+85) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - ((y * 0.3333333333333333) / 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 (y <= (-2.35d-17)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= 5.5d+85) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else
tmp = x - ((y * 0.3333333333333333d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.35e-17) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 5.5e+85) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - ((y * 0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.35e-17: tmp = x - (0.3333333333333333 * (y / z)) elif y <= 5.5e+85: tmp = x + (0.3333333333333333 * (t / (z * y))) else: tmp = x - ((y * 0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.35e-17) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= 5.5e+85) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); else tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.35e-17) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= 5.5e+85) tmp = x + (0.3333333333333333 * (t / (z * y))); else tmp = x - ((y * 0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.35e-17], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+85], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35 \cdot 10^{-17}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+85}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.35e-17Initial program 94.9%
Taylor expanded in t around 0 84.5%
if -2.35e-17 < y < 5.50000000000000008e85Initial program 92.7%
sub-neg92.7%
associate-+l+92.7%
+-commutative92.7%
remove-double-neg92.7%
distribute-frac-neg92.7%
distribute-neg-in92.7%
remove-double-neg92.7%
sub-neg92.7%
neg-mul-192.7%
times-frac92.0%
distribute-frac-neg92.0%
neg-mul-192.0%
*-commutative92.0%
associate-/l*92.0%
*-commutative92.0%
Simplified92.7%
Taylor expanded in t around inf 90.7%
if 5.50000000000000008e85 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.8%
Taylor expanded in t around 0 99.8%
neg-mul-199.8%
Simplified99.8%
associate-*l/99.9%
frac-2neg99.9%
add-sqr-sqrt0.0%
sqrt-unprod8.0%
sqr-neg8.0%
sqrt-unprod24.7%
add-sqr-sqrt24.7%
distribute-rgt-neg-out24.7%
add-sqr-sqrt0.0%
sqrt-unprod58.3%
sqr-neg58.3%
sqrt-unprod99.6%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification90.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.1e-91) (not (<= y 7.4e-35))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ t (* z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.1e-91) || !(y <= 7.4e-35)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (t / (z * 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 ((y <= (-6.1d-91)) .or. (.not. (y <= 7.4d-35))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = 0.3333333333333333d0 * (t / (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.1e-91) || !(y <= 7.4e-35)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (t / (z * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.1e-91) or not (y <= 7.4e-35): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = 0.3333333333333333 * (t / (z * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.1e-91) || !(y <= 7.4e-35)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.1e-91) || ~((y <= 7.4e-35))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = 0.3333333333333333 * (t / (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.1e-91], N[Not[LessEqual[y, 7.4e-35]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-91} \lor \neg \left(y \leq 7.4 \cdot 10^{-35}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\end{array}
\end{array}
if y < -6.0999999999999995e-91 or 7.3999999999999998e-35 < y Initial program 96.2%
sub-neg96.2%
associate-+l+96.2%
+-commutative96.2%
remove-double-neg96.2%
distribute-frac-neg96.2%
distribute-neg-in96.2%
remove-double-neg96.2%
sub-neg96.2%
neg-mul-196.2%
times-frac97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
*-commutative97.4%
associate-/l*97.3%
*-commutative97.3%
Simplified99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
Taylor expanded in y around inf 82.4%
associate-*r/82.4%
*-commutative82.4%
associate-*r/82.4%
Simplified82.4%
if -6.0999999999999995e-91 < y < 7.3999999999999998e-35Initial program 91.6%
Taylor expanded in z around 0 71.4%
Taylor expanded in t around inf 71.5%
Final simplification78.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.05e-93)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y 4.5e-38)
(* 0.3333333333333333 (/ t (* z y)))
(- x (/ (* y 0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e-93) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 4.5e-38) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = x - ((y * 0.3333333333333333) / 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 (y <= (-1.05d-93)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= 4.5d-38) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else
tmp = x - ((y * 0.3333333333333333d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e-93) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 4.5e-38) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = x - ((y * 0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.05e-93: tmp = x - (0.3333333333333333 * (y / z)) elif y <= 4.5e-38: tmp = 0.3333333333333333 * (t / (z * y)) else: tmp = x - ((y * 0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e-93) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= 4.5e-38) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); else tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.05e-93) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= 4.5e-38) tmp = 0.3333333333333333 * (t / (z * y)); else tmp = x - ((y * 0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05e-93], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-38], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-93}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-38}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.05e-93Initial program 94.6%
Taylor expanded in t around 0 80.8%
if -1.05e-93 < y < 4.50000000000000009e-38Initial program 91.6%
Taylor expanded in z around 0 71.4%
Taylor expanded in t around inf 71.5%
if 4.50000000000000009e-38 < y Initial program 98.3%
sub-neg98.3%
associate-+l+98.3%
+-commutative98.3%
remove-double-neg98.3%
distribute-frac-neg98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
sub-neg98.3%
neg-mul-198.3%
times-frac98.4%
distribute-frac-neg98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.3%
*-commutative98.3%
Simplified99.8%
Taylor expanded in t around 0 84.6%
neg-mul-184.6%
Simplified84.6%
associate-*l/84.7%
frac-2neg84.7%
add-sqr-sqrt0.0%
sqrt-unprod27.4%
sqr-neg27.4%
sqrt-unprod37.3%
add-sqr-sqrt37.3%
distribute-rgt-neg-out37.3%
add-sqr-sqrt0.0%
sqrt-unprod60.0%
sqr-neg60.0%
sqrt-unprod84.5%
add-sqr-sqrt84.7%
Applied egg-rr84.7%
Final simplification78.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e-92)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y 1.9e-36)
(* 0.3333333333333333 (/ t (* z y)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-92) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 1.9e-36) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = x + (y * (-0.3333333333333333 / 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 (y <= (-1.7d-92)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= 1.9d-36) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-92) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 1.9e-36) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e-92: tmp = x - (0.3333333333333333 * (y / z)) elif y <= 1.9e-36: tmp = 0.3333333333333333 * (t / (z * y)) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e-92) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= 1.9e-36) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e-92) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= 1.9e-36) tmp = 0.3333333333333333 * (t / (z * y)); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e-92], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-36], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-92}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-36}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.7000000000000001e-92Initial program 94.6%
Taylor expanded in t around 0 80.8%
if -1.7000000000000001e-92 < y < 1.89999999999999985e-36Initial program 91.6%
Taylor expanded in z around 0 71.4%
Taylor expanded in t around inf 71.5%
if 1.89999999999999985e-36 < y Initial program 98.3%
sub-neg98.3%
associate-+l+98.3%
+-commutative98.3%
remove-double-neg98.3%
distribute-frac-neg98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
sub-neg98.3%
neg-mul-198.3%
times-frac98.4%
distribute-frac-neg98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.3%
*-commutative98.3%
Simplified99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
Taylor expanded in y around inf 84.6%
associate-*r/84.7%
*-commutative84.7%
associate-*r/84.6%
Simplified84.6%
Final simplification78.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.2e-15) (not (<= y 5.9e+100))) (* (/ y z) -0.3333333333333333) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.2e-15) || !(y <= 5.9e+100)) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
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 ((y <= (-6.2d-15)) .or. (.not. (y <= 5.9d+100))) then
tmp = (y / z) * (-0.3333333333333333d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.2e-15) || !(y <= 5.9e+100)) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.2e-15) or not (y <= 5.9e+100): tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.2e-15) || !(y <= 5.9e+100)) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.2e-15) || ~((y <= 5.9e+100))) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.2e-15], N[Not[LessEqual[y, 5.9e+100]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-15} \lor \neg \left(y \leq 5.9 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.1999999999999998e-15 or 5.90000000000000027e100 < y Initial program 96.5%
Taylor expanded in z around 0 77.6%
Taylor expanded in t around 0 67.1%
if -6.1999999999999998e-15 < y < 5.90000000000000027e100Initial program 92.8%
sub-neg92.8%
associate-+l+92.8%
distribute-frac-neg92.8%
neg-mul-192.8%
*-commutative92.8%
times-frac92.8%
fma-define92.8%
metadata-eval92.8%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in x around inf 32.8%
Final simplification48.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.85e-14) (* (/ y z) -0.3333333333333333) (if (<= y 5.8e+100) x (/ (* y -0.3333333333333333) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e-14) {
tmp = (y / z) * -0.3333333333333333;
} else if (y <= 5.8e+100) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / 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 (y <= (-1.85d-14)) then
tmp = (y / z) * (-0.3333333333333333d0)
else if (y <= 5.8d+100) then
tmp = x
else
tmp = (y * (-0.3333333333333333d0)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e-14) {
tmp = (y / z) * -0.3333333333333333;
} else if (y <= 5.8e+100) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.85e-14: tmp = (y / z) * -0.3333333333333333 elif y <= 5.8e+100: tmp = x else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.85e-14) tmp = Float64(Float64(y / z) * -0.3333333333333333); elseif (y <= 5.8e+100) tmp = x; else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.85e-14) tmp = (y / z) * -0.3333333333333333; elseif (y <= 5.8e+100) tmp = x; else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.85e-14], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], If[LessEqual[y, 5.8e+100], x, N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+100}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.85000000000000001e-14Initial program 94.9%
Taylor expanded in z around 0 76.4%
Taylor expanded in t around 0 60.9%
if -1.85000000000000001e-14 < y < 5.8000000000000001e100Initial program 92.8%
sub-neg92.8%
associate-+l+92.8%
distribute-frac-neg92.8%
neg-mul-192.8%
*-commutative92.8%
times-frac92.8%
fma-define92.8%
metadata-eval92.8%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in x around inf 32.8%
if 5.8000000000000001e100 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
times-frac99.8%
fma-define99.8%
metadata-eval99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 99.6%
Taylor expanded in x around 0 79.8%
associate-*r/79.9%
Applied egg-rr79.9%
Final simplification48.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.8e-14) (* (/ y z) -0.3333333333333333) (if (<= y 5.8e+100) x (* y (/ -0.3333333333333333 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-14) {
tmp = (y / z) * -0.3333333333333333;
} else if (y <= 5.8e+100) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / 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 (y <= (-1.8d-14)) then
tmp = (y / z) * (-0.3333333333333333d0)
else if (y <= 5.8d+100) then
tmp = x
else
tmp = y * ((-0.3333333333333333d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-14) {
tmp = (y / z) * -0.3333333333333333;
} else if (y <= 5.8e+100) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e-14: tmp = (y / z) * -0.3333333333333333 elif y <= 5.8e+100: tmp = x else: tmp = y * (-0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-14) tmp = Float64(Float64(y / z) * -0.3333333333333333); elseif (y <= 5.8e+100) tmp = x; else tmp = Float64(y * Float64(-0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.8e-14) tmp = (y / z) * -0.3333333333333333; elseif (y <= 5.8e+100) tmp = x; else tmp = y * (-0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-14], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], If[LessEqual[y, 5.8e+100], x, N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+100}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.7999999999999999e-14Initial program 94.9%
Taylor expanded in z around 0 76.4%
Taylor expanded in t around 0 60.9%
if -1.7999999999999999e-14 < y < 5.8000000000000001e100Initial program 92.8%
sub-neg92.8%
associate-+l+92.8%
distribute-frac-neg92.8%
neg-mul-192.8%
*-commutative92.8%
times-frac92.8%
fma-define92.8%
metadata-eval92.8%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in x around inf 32.8%
if 5.8000000000000001e100 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
times-frac99.8%
fma-define99.8%
metadata-eval99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 99.6%
Taylor expanded in x around 0 79.8%
Final simplification48.7%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.5%
sub-neg94.5%
associate-+l+94.5%
distribute-frac-neg94.5%
neg-mul-194.5%
*-commutative94.5%
times-frac94.5%
fma-define94.5%
metadata-eval94.5%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in x around inf 29.0%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / 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 = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024145
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))