
(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 (<= (* z 3.0) 5e-78) (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))) (+ (+ x (/ t (* 3.0 (* z y)))) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 5e-78) {
tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
} else {
tmp = (x + (t / (3.0 * (z * y)))) + (y / (z * -3.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 * 3.0d0) <= 5d-78) then
tmp = x + (0.3333333333333333d0 * (((t / y) - y) / z))
else
tmp = (x + (t / (3.0d0 * (z * y)))) + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 5e-78) {
tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
} else {
tmp = (x + (t / (3.0 * (z * y)))) + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= 5e-78: tmp = x + (0.3333333333333333 * (((t / y) - y) / z)) else: tmp = (x + (t / (3.0 * (z * y)))) + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 5e-78) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z))); else tmp = Float64(Float64(x + Float64(t / Float64(3.0 * Float64(z * y)))) + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 5e-78) tmp = x + (0.3333333333333333 * (((t / y) - y) / z)); else tmp = (x + (t / (3.0 * (z * y)))) + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 5e-78], N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 5 \cdot 10^{-78}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{t}{3 \cdot \left(z \cdot y\right)}\right) + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < 4.9999999999999996e-78Initial program 93.4%
+-commutative93.4%
associate-+r-93.4%
+-commutative93.4%
associate--l+93.4%
sub-neg93.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-frac98.1%
distribute-frac-neg98.1%
neg-mul-198.1%
*-commutative98.1%
associate-/l*98.0%
*-commutative98.0%
Simplified98.1%
Taylor expanded in z around 0 98.1%
if 4.9999999999999996e-78 < (*.f64 z #s(literal 3 binary64)) Initial program 98.7%
+-commutative98.7%
associate-+r-98.7%
sub-neg98.7%
associate-*l*99.7%
*-commutative99.7%
distribute-frac-neg299.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.8%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.8e+23)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 9e+24)
(+ x (/ (/ t (* 3.0 y)) z))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e+23) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 9e+24) {
tmp = x + ((t / (3.0 * y)) / z);
} else {
tmp = x - (0.3333333333333333 * (y / 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 <= (-3.8d+23)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 9d+24) then
tmp = x + ((t / (3.0d0 * y)) / z)
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e+23) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 9e+24) {
tmp = x + ((t / (3.0 * y)) / z);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.8e+23: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 9e+24: tmp = x + ((t / (3.0 * y)) / z) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e+23) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 9e+24) tmp = Float64(x + Float64(Float64(t / Float64(3.0 * y)) / z)); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.8e+23) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 9e+24) tmp = x + ((t / (3.0 * y)) / z); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.8e+23], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+24], N[(x + N[(N[(t / N[(3.0 * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+24}:\\
\;\;\;\;x + \frac{\frac{t}{3 \cdot y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -3.79999999999999975e23Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate--l+99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
neg-mul-199.7%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.6%
*-commutative99.6%
Simplified99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 92.7%
if -3.79999999999999975e23 < y < 9.00000000000000039e24Initial program 90.7%
+-commutative90.7%
associate-+r-90.7%
+-commutative90.7%
associate--l+90.7%
sub-neg90.7%
remove-double-neg90.7%
distribute-frac-neg90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
sub-neg90.7%
neg-mul-190.7%
times-frac92.5%
distribute-frac-neg92.5%
neg-mul-192.5%
*-commutative92.5%
associate-/l*92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in t around inf 87.3%
metadata-eval87.3%
associate-/r*88.6%
times-frac88.6%
*-commutative88.6%
times-frac88.6%
associate-/r*89.3%
associate-*l/89.3%
*-lft-identity89.3%
Simplified89.3%
if 9.00000000000000039e24 < y Initial program 99.8%
Taylor expanded in t around 0 97.0%
Final simplification92.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.15e+24)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 1.06e+24)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+24) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 1.06e+24) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x - (0.3333333333333333 * (y / 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.15d+24)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 1.06d+24) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+24) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 1.06e+24) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e+24: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 1.06e+24: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e+24) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 1.06e+24) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.15e+24) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 1.06e+24) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e+24], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+24], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+24}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+24}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -1.15e24Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate--l+99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
neg-mul-199.7%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.6%
*-commutative99.6%
Simplified99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 92.7%
if -1.15e24 < y < 1.06e24Initial program 90.7%
+-commutative90.7%
associate-+r-90.7%
+-commutative90.7%
associate--l+90.7%
sub-neg90.7%
remove-double-neg90.7%
distribute-frac-neg90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
sub-neg90.7%
neg-mul-190.7%
times-frac92.5%
distribute-frac-neg92.5%
neg-mul-192.5%
*-commutative92.5%
associate-/l*92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in t around inf 88.6%
if 1.06e24 < y Initial program 99.8%
Taylor expanded in t around 0 97.0%
Final simplification91.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.1e+24)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 5.8e+25)
(+ x (* 0.3333333333333333 (/ t (* z y))))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+24) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 5.8e+25) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - (0.3333333333333333 * (y / 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.1d+24)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 5.8d+25) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+24) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 5.8e+25) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e+24: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 5.8e+25: tmp = x + (0.3333333333333333 * (t / (z * y))) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e+24) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 5.8e+25) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e+24) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 5.8e+25) tmp = x + (0.3333333333333333 * (t / (z * y))); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e+24], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+25], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+24}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+25}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -2.1000000000000001e24Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate--l+99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
neg-mul-199.7%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.6%
*-commutative99.6%
Simplified99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 92.7%
if -2.1000000000000001e24 < y < 5.7999999999999998e25Initial program 90.7%
+-commutative90.7%
associate-+r-90.7%
+-commutative90.7%
associate--l+90.7%
sub-neg90.7%
remove-double-neg90.7%
distribute-frac-neg90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
sub-neg90.7%
neg-mul-190.7%
times-frac92.5%
distribute-frac-neg92.5%
neg-mul-192.5%
*-commutative92.5%
associate-/l*92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in t around inf 87.3%
if 5.7999999999999998e25 < y Initial program 99.8%
Taylor expanded in t around 0 97.0%
Final simplification91.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.6e-15)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 780000.0)
(/ (* 0.3333333333333333 (/ t z)) y)
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e-15) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 780000.0) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x - (0.3333333333333333 * (y / 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 <= (-3.6d-15)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 780000.0d0) then
tmp = (0.3333333333333333d0 * (t / z)) / y
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e-15) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 780000.0) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.6e-15: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 780000.0: tmp = (0.3333333333333333 * (t / z)) / y else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.6e-15) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 780000.0) tmp = Float64(Float64(0.3333333333333333 * Float64(t / z)) / y); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.6e-15) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 780000.0) tmp = (0.3333333333333333 * (t / z)) / y; else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.6e-15], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 780000.0], N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-15}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 780000:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -3.6000000000000001e-15Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate--l+99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
neg-mul-199.7%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.6%
*-commutative99.6%
Simplified99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 91.3%
if -3.6000000000000001e-15 < y < 7.8e5Initial program 90.4%
+-commutative90.4%
associate-+r-90.4%
+-commutative90.4%
associate--l+90.4%
sub-neg90.4%
remove-double-neg90.4%
distribute-frac-neg90.4%
distribute-neg-in90.4%
remove-double-neg90.4%
sub-neg90.4%
neg-mul-190.4%
times-frac92.2%
distribute-frac-neg92.2%
neg-mul-192.2%
*-commutative92.2%
associate-/l*92.2%
*-commutative92.2%
Simplified92.3%
Taylor expanded in y around 0 94.8%
Taylor expanded in t around inf 72.5%
if 7.8e5 < y Initial program 99.8%
Taylor expanded in t around 0 95.8%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (<= x -2.8e+107) x (if (<= x 1.8e+107) (/ (/ y -3.0) z) (* y (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.8e+107) {
tmp = x;
} else if (x <= 1.8e+107) {
tmp = (y / -3.0) / z;
} else {
tmp = y * (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 <= (-2.8d+107)) then
tmp = x
else if (x <= 1.8d+107) then
tmp = (y / (-3.0d0)) / z
else
tmp = y * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.8e+107) {
tmp = x;
} else if (x <= 1.8e+107) {
tmp = (y / -3.0) / z;
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.8e+107: tmp = x elif x <= 1.8e+107: tmp = (y / -3.0) / z else: tmp = y * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.8e+107) tmp = x; elseif (x <= 1.8e+107) tmp = Float64(Float64(y / -3.0) / z); else tmp = Float64(y * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.8e+107) tmp = x; elseif (x <= 1.8e+107) tmp = (y / -3.0) / z; else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.8e+107], x, If[LessEqual[x, 1.8e+107], N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+107}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+107}:\\
\;\;\;\;\frac{\frac{y}{-3}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -2.79999999999999985e107Initial program 92.0%
+-commutative92.0%
associate-+r-92.0%
+-commutative92.0%
associate--l+92.0%
sub-neg92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 63.3%
if -2.79999999999999985e107 < x < 1.7999999999999999e107Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.1%
distribute-frac-neg96.1%
neg-mul-196.1%
*-commutative96.1%
associate-/l*96.0%
*-commutative96.0%
Simplified96.1%
Taylor expanded in y around inf 54.1%
associate-*r/54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in x around 0 45.0%
clear-num45.0%
un-div-inv45.1%
div-inv45.1%
metadata-eval45.1%
Applied egg-rr45.1%
*-commutative45.1%
associate-/r*45.1%
Simplified45.1%
if 1.7999999999999999e107 < x Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
+-commutative98.1%
associate--l+98.1%
sub-neg98.1%
remove-double-neg98.1%
distribute-frac-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
sub-neg98.1%
neg-mul-198.1%
times-frac93.9%
distribute-frac-neg93.9%
neg-mul-193.9%
*-commutative93.9%
associate-/l*93.9%
*-commutative93.9%
Simplified93.8%
Taylor expanded in y around inf 75.9%
associate-*r/75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in x around inf 64.6%
(FPCore (x y z t) :precision binary64 (if (<= x -5.9e+112) x (if (<= x 2.6e+107) (/ (* y -0.3333333333333333) z) (* y (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.9e+112) {
tmp = x;
} else if (x <= 2.6e+107) {
tmp = (y * -0.3333333333333333) / z;
} else {
tmp = y * (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 <= (-5.9d+112)) then
tmp = x
else if (x <= 2.6d+107) then
tmp = (y * (-0.3333333333333333d0)) / z
else
tmp = y * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.9e+112) {
tmp = x;
} else if (x <= 2.6e+107) {
tmp = (y * -0.3333333333333333) / z;
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.9e+112: tmp = x elif x <= 2.6e+107: tmp = (y * -0.3333333333333333) / z else: tmp = y * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.9e+112) tmp = x; elseif (x <= 2.6e+107) tmp = Float64(Float64(y * -0.3333333333333333) / z); else tmp = Float64(y * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.9e+112) tmp = x; elseif (x <= 2.6e+107) tmp = (y * -0.3333333333333333) / z; else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.9e+112], x, If[LessEqual[x, 2.6e+107], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{+112}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+107}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -5.9000000000000004e112Initial program 92.0%
+-commutative92.0%
associate-+r-92.0%
+-commutative92.0%
associate--l+92.0%
sub-neg92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 63.3%
if -5.9000000000000004e112 < x < 2.6000000000000001e107Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.1%
distribute-frac-neg96.1%
neg-mul-196.1%
*-commutative96.1%
associate-/l*96.0%
*-commutative96.0%
Simplified96.1%
Taylor expanded in y around inf 54.1%
associate-*r/54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in x around 0 45.0%
associate-*r/45.1%
Applied egg-rr45.1%
if 2.6000000000000001e107 < x Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
+-commutative98.1%
associate--l+98.1%
sub-neg98.1%
remove-double-neg98.1%
distribute-frac-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
sub-neg98.1%
neg-mul-198.1%
times-frac93.9%
distribute-frac-neg93.9%
neg-mul-193.9%
*-commutative93.9%
associate-/l*93.9%
*-commutative93.9%
Simplified93.8%
Taylor expanded in y around inf 75.9%
associate-*r/75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in x around inf 64.6%
(FPCore (x y z t) :precision binary64 (if (<= x -9.2e+102) x (if (<= x 7.5e+107) (/ y (* z -3.0)) (* y (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.2e+102) {
tmp = x;
} else if (x <= 7.5e+107) {
tmp = y / (z * -3.0);
} else {
tmp = y * (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 <= (-9.2d+102)) then
tmp = x
else if (x <= 7.5d+107) then
tmp = y / (z * (-3.0d0))
else
tmp = y * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.2e+102) {
tmp = x;
} else if (x <= 7.5e+107) {
tmp = y / (z * -3.0);
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.2e+102: tmp = x elif x <= 7.5e+107: tmp = y / (z * -3.0) else: tmp = y * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.2e+102) tmp = x; elseif (x <= 7.5e+107) tmp = Float64(y / Float64(z * -3.0)); else tmp = Float64(y * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.2e+102) tmp = x; elseif (x <= 7.5e+107) tmp = y / (z * -3.0); else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.2e+102], x, If[LessEqual[x, 7.5e+107], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+102}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -9.1999999999999995e102Initial program 92.0%
+-commutative92.0%
associate-+r-92.0%
+-commutative92.0%
associate--l+92.0%
sub-neg92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 63.3%
if -9.1999999999999995e102 < x < 7.4999999999999996e107Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.1%
distribute-frac-neg96.1%
neg-mul-196.1%
*-commutative96.1%
associate-/l*96.0%
*-commutative96.0%
Simplified96.1%
Taylor expanded in y around inf 54.1%
associate-*r/54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in x around 0 45.0%
clear-num45.0%
un-div-inv45.1%
div-inv45.1%
metadata-eval45.1%
Applied egg-rr45.1%
if 7.4999999999999996e107 < x Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
+-commutative98.1%
associate--l+98.1%
sub-neg98.1%
remove-double-neg98.1%
distribute-frac-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
sub-neg98.1%
neg-mul-198.1%
times-frac93.9%
distribute-frac-neg93.9%
neg-mul-193.9%
*-commutative93.9%
associate-/l*93.9%
*-commutative93.9%
Simplified93.8%
Taylor expanded in y around inf 75.9%
associate-*r/75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in x around inf 64.6%
(FPCore (x y z t) :precision binary64 (if (<= x -1.4e+107) x (if (<= x 1.7e+107) (* -0.3333333333333333 (/ y z)) (* y (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.4e+107) {
tmp = x;
} else if (x <= 1.7e+107) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = y * (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 <= (-1.4d+107)) then
tmp = x
else if (x <= 1.7d+107) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = y * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.4e+107) {
tmp = x;
} else if (x <= 1.7e+107) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.4e+107: tmp = x elif x <= 1.7e+107: tmp = -0.3333333333333333 * (y / z) else: tmp = y * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.4e+107) tmp = x; elseif (x <= 1.7e+107) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = Float64(y * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.4e+107) tmp = x; elseif (x <= 1.7e+107) tmp = -0.3333333333333333 * (y / z); else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.4e+107], x, If[LessEqual[x, 1.7e+107], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+107}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+107}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -1.39999999999999992e107Initial program 92.0%
+-commutative92.0%
associate-+r-92.0%
+-commutative92.0%
associate--l+92.0%
sub-neg92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 63.3%
if -1.39999999999999992e107 < x < 1.6999999999999998e107Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
sub-neg95.1%
associate-*l*95.7%
*-commutative95.7%
distribute-frac-neg295.7%
distribute-rgt-neg-in95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in z around 0 95.6%
Taylor expanded in y around inf 45.1%
if 1.6999999999999998e107 < x Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
+-commutative98.1%
associate--l+98.1%
sub-neg98.1%
remove-double-neg98.1%
distribute-frac-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
sub-neg98.1%
neg-mul-198.1%
times-frac93.9%
distribute-frac-neg93.9%
neg-mul-193.9%
*-commutative93.9%
associate-/l*93.9%
*-commutative93.9%
Simplified93.8%
Taylor expanded in y around inf 75.9%
associate-*r/75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in x around inf 64.6%
(FPCore (x y z t) :precision binary64 (if (<= x -1.4e+113) x (if (<= x 1.04e+108) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.4e+113) {
tmp = x;
} else if (x <= 1.04e+108) {
tmp = -0.3333333333333333 * (y / z);
} 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 (x <= (-1.4d+113)) then
tmp = x
else if (x <= 1.04d+108) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.4e+113) {
tmp = x;
} else if (x <= 1.04e+108) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.4e+113: tmp = x elif x <= 1.04e+108: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.4e+113) tmp = x; elseif (x <= 1.04e+108) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.4e+113) tmp = x; elseif (x <= 1.04e+108) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.4e+113], x, If[LessEqual[x, 1.04e+108], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+113}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.04 \cdot 10^{+108}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.39999999999999999e113 or 1.04e108 < x Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac95.8%
distribute-frac-neg95.8%
neg-mul-195.8%
*-commutative95.8%
associate-/l*95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x around inf 62.9%
if -1.39999999999999999e113 < x < 1.04e108Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
sub-neg95.1%
associate-*l*95.7%
*-commutative95.7%
distribute-frac-neg295.7%
distribute-rgt-neg-in95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in z around 0 95.6%
Taylor expanded in y around inf 45.1%
(FPCore (x y z t) :precision binary64 (+ x (/ (* 0.3333333333333333 (- (/ t y) y)) z)))
double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 * ((t / y) - y)) / 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 + ((0.3333333333333333d0 * ((t / y) - y)) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 * ((t / y) - y)) / z);
}
def code(x, y, z, t): return x + ((0.3333333333333333 * ((t / y) - y)) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(0.3333333333333333 * Float64(Float64(t / y) - y)) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}
\end{array}
Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 96.0%
+-commutative96.0%
associate-*r/96.0%
Simplified96.0%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * (((t / y) - y) / 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 + (0.3333333333333333d0 * (((t / y) - y) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * (((t / y) - y) / z));
}
def code(x, y, z, t): return x + (0.3333333333333333 * (((t / y) - y) / z))
function code(x, y, z, t) return Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z))) end
function tmp = code(x, y, z, t) tmp = x + (0.3333333333333333 * (((t / y) - y) / z)); end
code[x_, y_, z_, t_] := N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}
\end{array}
Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in z around 0 96.0%
(FPCore (x y z t) :precision binary64 (+ x (/ (* y -0.3333333333333333) z)))
double code(double x, double y, double z, double t) {
return x + ((y * -0.3333333333333333) / 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 * (-0.3333333333333333d0)) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * -0.3333333333333333) / z);
}
def code(x, y, z, t): return x + ((y * -0.3333333333333333) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * -0.3333333333333333) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((y * -0.3333333333333333) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot -0.3333333333333333}{z}
\end{array}
Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 96.0%
+-commutative96.0%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in t around 0 61.1%
Final simplification61.1%
(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 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in x around inf 29.1%
(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 2024123
(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))))