
(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 15 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 (<= t 1.16e+140)
(+
(+ x (* -0.3333333333333333 (/ y z)))
(/ (* 0.3333333333333333 (/ t z)) y))
(+ x (* (/ -0.3333333333333333 z) (- y (/ t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.16e+140) {
tmp = (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / y);
} else {
tmp = x + ((-0.3333333333333333 / z) * (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 <= 1.16d+140) then
tmp = (x + ((-0.3333333333333333d0) * (y / z))) + ((0.3333333333333333d0 * (t / z)) / y)
else
tmp = x + (((-0.3333333333333333d0) / z) * (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 <= 1.16e+140) {
tmp = (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / y);
} else {
tmp = x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.16e+140: tmp = (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / y) else: tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.16e+140) tmp = Float64(Float64(x + Float64(-0.3333333333333333 * Float64(y / z))) + Float64(Float64(0.3333333333333333 * Float64(t / z)) / y)); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.16e+140) tmp = (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / y); else tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.16e+140], N[(N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.16 \cdot 10^{+140}:\\
\;\;\;\;\left(x + -0.3333333333333333 \cdot \frac{y}{z}\right) + \frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)\\
\end{array}
\end{array}
if t < 1.16e140Initial program 95.5%
sub-neg95.5%
distribute-frac-neg95.5%
neg-mul-195.5%
*-commutative95.5%
times-frac95.4%
metadata-eval95.4%
associate-/l/97.5%
associate-/l/97.5%
Simplified97.5%
associate-/l/97.5%
*-un-lft-identity97.5%
times-frac97.5%
associate-/l/98.0%
times-frac95.4%
associate-*l*95.4%
*-commutative95.4%
times-frac99.5%
*-un-lft-identity99.5%
*-commutative99.5%
times-frac99.5%
metadata-eval99.5%
Applied egg-rr99.5%
associate-*l/99.5%
*-lft-identity99.5%
Simplified99.5%
if 1.16e140 < t Initial program 91.8%
Simplified94.9%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.36e-21)
(+ x (/ y (* z -3.0)))
(if (<= y 800000.0)
(+ x (/ (/ (* t -0.3333333333333333) z) (- y)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.36e-21) {
tmp = x + (y / (z * -3.0));
} else if (y <= 800000.0) {
tmp = x + (((t * -0.3333333333333333) / 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.36d-21)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 800000.0d0) then
tmp = x + (((t * (-0.3333333333333333d0)) / 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.36e-21) {
tmp = x + (y / (z * -3.0));
} else if (y <= 800000.0) {
tmp = x + (((t * -0.3333333333333333) / z) / -y);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.36e-21: tmp = x + (y / (z * -3.0)) elif y <= 800000.0: tmp = x + (((t * -0.3333333333333333) / z) / -y) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.36e-21) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 800000.0) tmp = Float64(x + Float64(Float64(Float64(t * -0.3333333333333333) / z) / Float64(-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.36e-21) tmp = x + (y / (z * -3.0)); elseif (y <= 800000.0) tmp = x + (((t * -0.3333333333333333) / z) / -y); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.36e-21], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 800000.0], N[(x + N[(N[(N[(t * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.36 \cdot 10^{-21}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 800000:\\
\;\;\;\;x + \frac{\frac{t \cdot -0.3333333333333333}{z}}{-y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.3599999999999999e-21Initial program 96.9%
Simplified99.7%
Taylor expanded in y around inf 95.4%
*-commutative95.4%
clear-num95.4%
un-div-inv95.4%
div-inv95.6%
metadata-eval95.6%
Applied egg-rr95.6%
if -1.3599999999999999e-21 < y < 8e5Initial program 92.8%
Simplified94.2%
Taylor expanded in y around 0 90.1%
associate-*r/90.0%
frac-2neg90.0%
*-commutative90.0%
distribute-rgt-neg-in90.0%
Applied egg-rr90.0%
associate-/r*96.0%
distribute-lft-neg-in96.0%
metadata-eval96.0%
Simplified96.0%
if 8e5 < y Initial program 96.7%
Simplified99.7%
Taylor expanded in y around inf 96.3%
Final simplification96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* -0.3333333333333333 y) z)))
(if (<= y -1.45e+26)
t_1
(if (<= y -1.25e-111)
x
(if (<= y 4.1e+20) (* 0.3333333333333333 (/ (/ t z) y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (-0.3333333333333333 * y) / z;
double tmp;
if (y <= -1.45e+26) {
tmp = t_1;
} else if (y <= -1.25e-111) {
tmp = x;
} else if (y <= 4.1e+20) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((-0.3333333333333333d0) * y) / z
if (y <= (-1.45d+26)) then
tmp = t_1
else if (y <= (-1.25d-111)) then
tmp = x
else if (y <= 4.1d+20) then
tmp = 0.3333333333333333d0 * ((t / z) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-0.3333333333333333 * y) / z;
double tmp;
if (y <= -1.45e+26) {
tmp = t_1;
} else if (y <= -1.25e-111) {
tmp = x;
} else if (y <= 4.1e+20) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-0.3333333333333333 * y) / z tmp = 0 if y <= -1.45e+26: tmp = t_1 elif y <= -1.25e-111: tmp = x elif y <= 4.1e+20: tmp = 0.3333333333333333 * ((t / z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-0.3333333333333333 * y) / z) tmp = 0.0 if (y <= -1.45e+26) tmp = t_1; elseif (y <= -1.25e-111) tmp = x; elseif (y <= 4.1e+20) tmp = Float64(0.3333333333333333 * Float64(Float64(t / z) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-0.3333333333333333 * y) / z; tmp = 0.0; if (y <= -1.45e+26) tmp = t_1; elseif (y <= -1.25e-111) tmp = x; elseif (y <= 4.1e+20) tmp = 0.3333333333333333 * ((t / z) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.45e+26], t$95$1, If[LessEqual[y, -1.25e-111], x, If[LessEqual[y, 4.1e+20], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-111}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+20}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.45e26 or 4.1e20 < y Initial program 96.7%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 70.9%
associate-*r/71.0%
Applied egg-rr71.0%
if -1.45e26 < y < -1.2500000000000001e-111Initial program 96.0%
Simplified99.7%
Taylor expanded in x around inf 53.4%
if -1.2500000000000001e-111 < y < 4.1e20Initial program 92.6%
Simplified93.3%
+-commutative93.3%
fma-def93.3%
Applied egg-rr93.3%
Taylor expanded in y around 0 60.5%
*-commutative60.5%
associate-/r*65.8%
Simplified65.8%
Final simplification67.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.15e-22)
(+ x (/ y (* z -3.0)))
(if (<= y 27000000.0)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.15e-22) {
tmp = x + (y / (z * -3.0));
} else if (y <= 27000000.0) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} 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 <= (-3.15d-22)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 27000000.0d0) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
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 <= -3.15e-22) {
tmp = x + (y / (z * -3.0));
} else if (y <= 27000000.0) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.15e-22: tmp = x + (y / (z * -3.0)) elif y <= 27000000.0: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.15e-22) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 27000000.0) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); 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 <= -3.15e-22) tmp = x + (y / (z * -3.0)); elseif (y <= 27000000.0) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.15e-22], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 27000000.0], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{-22}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 27000000:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.15e-22Initial program 96.9%
Simplified99.7%
Taylor expanded in y around inf 95.4%
*-commutative95.4%
clear-num95.4%
un-div-inv95.4%
div-inv95.6%
metadata-eval95.6%
Applied egg-rr95.6%
if -3.15e-22 < y < 2.7e7Initial program 92.8%
Simplified94.2%
Taylor expanded in y around 0 90.1%
if 2.7e7 < y Initial program 96.7%
Simplified99.7%
Taylor expanded in y around inf 96.3%
Final simplification93.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.24e-21)
(+ x (/ y (* z -3.0)))
(if (<= y 54000000.0)
(+ x (* 0.3333333333333333 (/ (/ t y) z)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.24e-21) {
tmp = x + (y / (z * -3.0));
} else if (y <= 54000000.0) {
tmp = x + (0.3333333333333333 * ((t / y) / z));
} 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.24d-21)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 54000000.0d0) then
tmp = x + (0.3333333333333333d0 * ((t / y) / z))
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.24e-21) {
tmp = x + (y / (z * -3.0));
} else if (y <= 54000000.0) {
tmp = x + (0.3333333333333333 * ((t / y) / z));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.24e-21: tmp = x + (y / (z * -3.0)) elif y <= 54000000.0: tmp = x + (0.3333333333333333 * ((t / y) / z)) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.24e-21) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 54000000.0) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / y) / z))); 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.24e-21) tmp = x + (y / (z * -3.0)); elseif (y <= 54000000.0) tmp = x + (0.3333333333333333 * ((t / y) / z)); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.24e-21], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 54000000.0], N[(x + N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $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.24 \cdot 10^{-21}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 54000000:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.24000000000000005e-21Initial program 96.9%
Simplified99.7%
Taylor expanded in y around inf 95.4%
*-commutative95.4%
clear-num95.4%
un-div-inv95.4%
div-inv95.6%
metadata-eval95.6%
Applied egg-rr95.6%
if -1.24000000000000005e-21 < y < 5.4e7Initial program 92.8%
Simplified94.2%
Taylor expanded in y around 0 90.1%
expm1-log1p-u51.1%
expm1-udef49.1%
*-commutative49.1%
Applied egg-rr49.1%
expm1-def51.1%
expm1-log1p90.1%
associate-/l/90.7%
Simplified90.7%
if 5.4e7 < y Initial program 96.7%
Simplified99.7%
Taylor expanded in y around inf 96.3%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.4e-22)
(+ x (/ y (* z -3.0)))
(if (<= y 7.7e+34)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-22) {
tmp = x + (y / (z * -3.0));
} else if (y <= 7.7e+34) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} 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 <= (-3.4d-22)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 7.7d+34) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
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 <= -3.4e-22) {
tmp = x + (y / (z * -3.0));
} else if (y <= 7.7e+34) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.4e-22: tmp = x + (y / (z * -3.0)) elif y <= 7.7e+34: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e-22) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 7.7e+34) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); 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 <= -3.4e-22) tmp = x + (y / (z * -3.0)); elseif (y <= 7.7e+34) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-22], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.7e+34], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-22}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 7.7 \cdot 10^{+34}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.3999999999999998e-22Initial program 96.9%
Simplified99.7%
Taylor expanded in y around inf 95.4%
*-commutative95.4%
clear-num95.4%
un-div-inv95.4%
div-inv95.6%
metadata-eval95.6%
Applied egg-rr95.6%
if -3.3999999999999998e-22 < y < 7.6999999999999999e34Initial program 92.2%
Simplified94.3%
Taylor expanded in y around 0 88.8%
associate-/r*90.1%
associate-*r/90.1%
*-commutative90.1%
associate-*r/90.2%
Simplified90.2%
if 7.6999999999999999e34 < y Initial program 98.1%
Simplified99.7%
Taylor expanded in y around inf 97.7%
Final simplification93.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.4e-117) (not (<= y 4200.0))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ (/ t z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.4e-117) || !(y <= 4200.0)) {
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 <= (-2.4d-117)) .or. (.not. (y <= 4200.0d0))) 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 <= -2.4e-117) || !(y <= 4200.0)) {
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 <= -2.4e-117) or not (y <= 4200.0): 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 <= -2.4e-117) || !(y <= 4200.0)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = 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 <= -2.4e-117) || ~((y <= 4200.0))) 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, -2.4e-117], N[Not[LessEqual[y, 4200.0]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-117} \lor \neg \left(y \leq 4200\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\end{array}
\end{array}
if y < -2.40000000000000014e-117 or 4200 < y Initial program 96.6%
Simplified99.7%
Taylor expanded in y around inf 91.7%
if -2.40000000000000014e-117 < y < 4200Initial program 92.4%
Simplified93.1%
+-commutative93.1%
fma-def93.1%
Applied egg-rr93.1%
Taylor expanded in y around 0 61.2%
*-commutative61.2%
associate-/r*66.7%
Simplified66.7%
Final simplification81.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -8.5e-116)
(+ x (/ y (* z -3.0)))
(if (<= y 150.0)
(* 0.3333333333333333 (/ (/ t z) y))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e-116) {
tmp = x + (y / (z * -3.0));
} else if (y <= 150.0) {
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 <= (-8.5d-116)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 150.0d0) 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 <= -8.5e-116) {
tmp = x + (y / (z * -3.0));
} else if (y <= 150.0) {
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 <= -8.5e-116: tmp = x + (y / (z * -3.0)) elif y <= 150.0: 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 <= -8.5e-116) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 150.0) tmp = Float64(0.3333333333333333 * Float64(Float64(t / 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 <= -8.5e-116) tmp = x + (y / (z * -3.0)); elseif (y <= 150.0) 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, -8.5e-116], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 150.0], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-116}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 150:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -8.4999999999999995e-116Initial program 96.5%
Simplified99.7%
Taylor expanded in y around inf 88.2%
*-commutative88.2%
clear-num88.1%
un-div-inv88.2%
div-inv88.3%
metadata-eval88.3%
Applied egg-rr88.3%
if -8.4999999999999995e-116 < y < 150Initial program 92.4%
Simplified93.1%
+-commutative93.1%
fma-def93.1%
Applied egg-rr93.1%
Taylor expanded in y around 0 61.2%
*-commutative61.2%
associate-/r*66.7%
Simplified66.7%
if 150 < y Initial program 96.7%
Simplified99.7%
Taylor expanded in y around inf 96.3%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (+ x (* -0.3333333333333333 (/ (- y (/ t y)) z))))
double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / 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) * ((y - (t / y)) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / y)) / z));
}
def code(x, y, z, t): return x + (-0.3333333333333333 * ((y - (t / y)) / z))
function code(x, y, z, t) return Float64(x + Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z))) end
function tmp = code(x, y, z, t) tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)); end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + -0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}
\end{array}
Initial program 95.0%
Simplified97.1%
Taylor expanded in z around 0 97.1%
Final simplification97.1%
(FPCore (x y z t) :precision binary64 (+ x (* (/ -0.3333333333333333 z) (- y (/ t y)))))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / z) * (y - (t / 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 + (((-0.3333333333333333d0) / z) * (y - (t / y)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
def code(x, y, z, t): return x + ((-0.3333333333333333 / z) * (y - (t / y)))
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y)))) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)
\end{array}
Initial program 95.0%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t) :precision binary64 (+ x (/ (* -0.3333333333333333 (- y (/ t y))) z)))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y - (t / 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) * (y - (t / y))) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y - (t / y))) / z);
}
def code(x, y, z, t): return x + ((-0.3333333333333333 * (y - (t / y))) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y - Float64(t / y))) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}
\end{array}
Initial program 95.0%
Simplified97.1%
Taylor expanded in z around 0 97.1%
associate-*r/97.1%
Applied egg-rr97.1%
Final simplification97.1%
(FPCore (x y z t) :precision binary64 (if (<= z -7.5e+19) x (if (<= z 6.5e+77) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.5e+19) {
tmp = x;
} else if (z <= 6.5e+77) {
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 (z <= (-7.5d+19)) then
tmp = x
else if (z <= 6.5d+77) 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 (z <= -7.5e+19) {
tmp = x;
} else if (z <= 6.5e+77) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.5e+19: tmp = x elif z <= 6.5e+77: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.5e+19) tmp = x; elseif (z <= 6.5e+77) 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 (z <= -7.5e+19) tmp = x; elseif (z <= 6.5e+77) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.5e+19], x, If[LessEqual[z, 6.5e+77], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+19}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+77}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.5e19 or 6.5e77 < z Initial program 98.9%
Simplified93.5%
Taylor expanded in x around inf 63.7%
if -7.5e19 < z < 6.5e77Initial program 92.2%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 51.1%
Final simplification56.3%
(FPCore (x y z t) :precision binary64 (if (<= z -4.4e+17) x (if (<= z 1.7e+78) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.4e+17) {
tmp = x;
} else if (z <= 1.7e+78) {
tmp = y * (-0.3333333333333333 / 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 (z <= (-4.4d+17)) then
tmp = x
else if (z <= 1.7d+78) then
tmp = y * ((-0.3333333333333333d0) / 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 (z <= -4.4e+17) {
tmp = x;
} else if (z <= 1.7e+78) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.4e+17: tmp = x elif z <= 1.7e+78: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.4e+17) tmp = x; elseif (z <= 1.7e+78) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.4e+17) tmp = x; elseif (z <= 1.7e+78) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.4e+17], x, If[LessEqual[z, 1.7e+78], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+78}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.4e17 or 1.70000000000000004e78 < z Initial program 98.9%
Simplified93.5%
Taylor expanded in x around inf 63.7%
if -4.4e17 < z < 1.70000000000000004e78Initial program 92.2%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 51.1%
associate-*r/51.2%
Applied egg-rr51.2%
associate-/l*51.2%
associate-/r/51.2%
Applied egg-rr51.2%
Final simplification56.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.38e+20) x (if (<= z 1.5e+79) (/ (* -0.3333333333333333 y) z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.38e+20) {
tmp = x;
} else if (z <= 1.5e+79) {
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 (z <= (-1.38d+20)) then
tmp = x
else if (z <= 1.5d+79) 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 (z <= -1.38e+20) {
tmp = x;
} else if (z <= 1.5e+79) {
tmp = (-0.3333333333333333 * y) / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.38e+20: tmp = x elif z <= 1.5e+79: tmp = (-0.3333333333333333 * y) / z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.38e+20) tmp = x; elseif (z <= 1.5e+79) tmp = Float64(Float64(-0.3333333333333333 * y) / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.38e+20) tmp = x; elseif (z <= 1.5e+79) tmp = (-0.3333333333333333 * y) / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.38e+20], x, If[LessEqual[z, 1.5e+79], N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.38 \cdot 10^{+20}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+79}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.38e20 or 1.49999999999999987e79 < z Initial program 98.9%
Simplified93.5%
Taylor expanded in x around inf 63.7%
if -1.38e20 < z < 1.49999999999999987e79Initial program 92.2%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 51.1%
associate-*r/51.2%
Applied egg-rr51.2%
Final simplification56.4%
(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.0%
Simplified97.1%
Taylor expanded in x around inf 32.7%
Final simplification32.7%
(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 2023280
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))