
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y - z) / (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
def code(x, y, z, t): return x * ((y - z) / (t - z))
function code(x, y, z, t) return Float64(x * Float64(Float64(y - z) / Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x * ((y - z) / (t - z)); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 83.8%
associate-/l*98.6%
Simplified98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -0.0075)
t_1
(if (<= z 8.5e-63)
(/ x (/ (- t z) y))
(if (<= z 9e+138) (/ (* x z) (- z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -0.0075) {
tmp = t_1;
} else if (z <= 8.5e-63) {
tmp = x / ((t - z) / y);
} else if (z <= 9e+138) {
tmp = (x * z) / (z - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-0.0075d0)) then
tmp = t_1
else if (z <= 8.5d-63) then
tmp = x / ((t - z) / y)
else if (z <= 9d+138) then
tmp = (x * z) / (z - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -0.0075) {
tmp = t_1;
} else if (z <= 8.5e-63) {
tmp = x / ((t - z) / y);
} else if (z <= 9e+138) {
tmp = (x * z) / (z - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -0.0075: tmp = t_1 elif z <= 8.5e-63: tmp = x / ((t - z) / y) elif z <= 9e+138: tmp = (x * z) / (z - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -0.0075) tmp = t_1; elseif (z <= 8.5e-63) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (z <= 9e+138) tmp = Float64(Float64(x * z) / Float64(z - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -0.0075) tmp = t_1; elseif (z <= 8.5e-63) tmp = x / ((t - z) / y); elseif (z <= 9e+138) tmp = (x * z) / (z - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0075], t$95$1, If[LessEqual[z, 8.5e-63], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+138], N[(N[(x * z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -0.0075:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+138}:\\
\;\;\;\;\frac{x \cdot z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.0074999999999999997 or 8.99999999999999963e138 < z Initial program 73.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 63.4%
mul-1-neg63.4%
associate-/l*88.2%
distribute-rgt-neg-in88.2%
distribute-frac-neg88.2%
sub-neg88.2%
distribute-neg-in88.2%
remove-double-neg88.2%
+-commutative88.2%
sub-neg88.2%
div-sub88.2%
*-inverses88.2%
Simplified88.2%
if -0.0074999999999999997 < z < 8.49999999999999969e-63Initial program 88.3%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in x around 0 88.3%
*-rgt-identity88.3%
times-frac88.5%
/-rgt-identity88.5%
associate-/r/96.5%
Simplified96.5%
Taylor expanded in y around inf 85.7%
if 8.49999999999999969e-63 < z < 8.99999999999999963e138Initial program 95.4%
remove-double-neg95.4%
distribute-lft-neg-out95.4%
distribute-neg-frac95.4%
distribute-neg-frac295.4%
distribute-lft-neg-out95.4%
distribute-rgt-neg-in95.4%
sub-neg95.4%
distribute-neg-in95.4%
remove-double-neg95.4%
+-commutative95.4%
sub-neg95.4%
sub-neg95.4%
distribute-neg-in95.4%
remove-double-neg95.4%
+-commutative95.4%
sub-neg95.4%
Simplified95.4%
Taylor expanded in y around 0 83.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.1e-19) (not (<= z 2.3e-50))) (* x (- 1.0 (/ y z))) (* x (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e-19) || !(z <= 2.3e-50)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.1d-19)) .or. (.not. (z <= 2.3d-50))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e-19) || !(z <= 2.3e-50)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.1e-19) or not (z <= 2.3e-50): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.1e-19) || !(z <= 2.3e-50)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.1e-19) || ~((z <= 2.3e-50))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1e-19], N[Not[LessEqual[z, 2.3e-50]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-19} \lor \neg \left(z \leq 2.3 \cdot 10^{-50}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -1.0999999999999999e-19 or 2.3000000000000002e-50 < z Initial program 80.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 61.4%
mul-1-neg61.4%
associate-/l*77.5%
distribute-rgt-neg-in77.5%
distribute-frac-neg77.5%
sub-neg77.5%
distribute-neg-in77.5%
remove-double-neg77.5%
+-commutative77.5%
sub-neg77.5%
div-sub77.5%
*-inverses77.5%
Simplified77.5%
if -1.0999999999999999e-19 < z < 2.3000000000000002e-50Initial program 87.9%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around 0 62.5%
associate-/l*71.4%
Simplified71.4%
Final simplification74.8%
(FPCore (x y z t) :precision binary64 (if (<= z -0.0049) (* x (- 1.0 (/ y z))) (if (<= z 2.85e-64) (/ x (/ (- t z) y)) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.0049) {
tmp = x * (1.0 - (y / z));
} else if (z <= 2.85e-64) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-0.0049d0)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 2.85d-64) then
tmp = x / ((t - z) / y)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.0049) {
tmp = x * (1.0 - (y / z));
} else if (z <= 2.85e-64) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.0049: tmp = x * (1.0 - (y / z)) elif z <= 2.85e-64: tmp = x / ((t - z) / y) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.0049) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 2.85e-64) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.0049) tmp = x * (1.0 - (y / z)); elseif (z <= 2.85e-64) tmp = x / ((t - z) / y); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.0049], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e-64], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0049:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-64}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -0.0048999999999999998Initial program 83.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 74.7%
mul-1-neg74.7%
associate-/l*89.2%
distribute-rgt-neg-in89.2%
distribute-frac-neg89.2%
sub-neg89.2%
distribute-neg-in89.2%
remove-double-neg89.2%
+-commutative89.2%
sub-neg89.2%
div-sub89.2%
*-inverses89.2%
Simplified89.2%
if -0.0048999999999999998 < z < 2.8500000000000001e-64Initial program 88.3%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in x around 0 88.3%
*-rgt-identity88.3%
times-frac88.5%
/-rgt-identity88.5%
associate-/r/96.5%
Simplified96.5%
Taylor expanded in y around inf 85.7%
if 2.8500000000000001e-64 < z Initial program 77.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 68.4%
mul-1-neg68.4%
distribute-neg-frac268.4%
sub-neg68.4%
distribute-neg-in68.4%
remove-double-neg68.4%
+-commutative68.4%
sub-neg68.4%
associate-/l*79.8%
Simplified79.8%
(FPCore (x y z t) :precision binary64 (if (<= z -2.2e-19) (* x (- 1.0 (/ y z))) (if (<= z 1.75e-61) (* x (/ (- y z) t)) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e-19) {
tmp = x * (1.0 - (y / z));
} else if (z <= 1.75e-61) {
tmp = x * ((y - z) / t);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.2d-19)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 1.75d-61) then
tmp = x * ((y - z) / t)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e-19) {
tmp = x * (1.0 - (y / z));
} else if (z <= 1.75e-61) {
tmp = x * ((y - z) / t);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e-19: tmp = x * (1.0 - (y / z)) elif z <= 1.75e-61: tmp = x * ((y - z) / t) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e-19) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 1.75e-61) tmp = Float64(x * Float64(Float64(y - z) / t)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e-19) tmp = x * (1.0 - (y / z)); elseif (z <= 1.75e-61) tmp = x * ((y - z) / t); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e-19], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-61], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-19}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-61}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -2.1999999999999998e-19Initial program 85.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 74.9%
mul-1-neg74.9%
associate-/l*88.1%
distribute-rgt-neg-in88.1%
distribute-frac-neg88.1%
sub-neg88.1%
distribute-neg-in88.1%
remove-double-neg88.1%
+-commutative88.1%
sub-neg88.1%
div-sub88.1%
*-inverses88.1%
Simplified88.1%
if -2.1999999999999998e-19 < z < 1.7500000000000002e-61Initial program 87.7%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in t around inf 69.6%
associate-/l*79.0%
Simplified79.0%
if 1.7500000000000002e-61 < z Initial program 77.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 68.4%
mul-1-neg68.4%
distribute-neg-frac268.4%
sub-neg68.4%
distribute-neg-in68.4%
remove-double-neg68.4%
+-commutative68.4%
sub-neg68.4%
associate-/l*79.8%
Simplified79.8%
(FPCore (x y z t) :precision binary64 (if (<= z -3.7e-20) (* x (- 1.0 (/ y z))) (if (<= z 6.4e-63) (* x (/ y t)) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e-20) {
tmp = x * (1.0 - (y / z));
} else if (z <= 6.4e-63) {
tmp = x * (y / t);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.7d-20)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 6.4d-63) then
tmp = x * (y / t)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e-20) {
tmp = x * (1.0 - (y / z));
} else if (z <= 6.4e-63) {
tmp = x * (y / t);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.7e-20: tmp = x * (1.0 - (y / z)) elif z <= 6.4e-63: tmp = x * (y / t) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e-20) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 6.4e-63) tmp = Float64(x * Float64(y / t)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.7e-20) tmp = x * (1.0 - (y / z)); elseif (z <= 6.4e-63) tmp = x * (y / t); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e-20], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-63], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-20}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -3.7000000000000001e-20Initial program 85.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 74.9%
mul-1-neg74.9%
associate-/l*88.1%
distribute-rgt-neg-in88.1%
distribute-frac-neg88.1%
sub-neg88.1%
distribute-neg-in88.1%
remove-double-neg88.1%
+-commutative88.1%
sub-neg88.1%
div-sub88.1%
*-inverses88.1%
Simplified88.1%
if -3.7000000000000001e-20 < z < 6.39999999999999978e-63Initial program 87.7%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around 0 63.5%
associate-/l*72.6%
Simplified72.6%
if 6.39999999999999978e-63 < z Initial program 77.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 68.4%
mul-1-neg68.4%
distribute-neg-frac268.4%
sub-neg68.4%
distribute-neg-in68.4%
remove-double-neg68.4%
+-commutative68.4%
sub-neg68.4%
associate-/l*79.8%
Simplified79.8%
(FPCore (x y z t) :precision binary64 (if (<= z -8.2) x (if (<= z 4.8e-49) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2) {
tmp = x;
} else if (z <= 4.8e-49) {
tmp = x * (y / t);
} 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 <= (-8.2d0)) then
tmp = x
else if (z <= 4.8d-49) then
tmp = x * (y / t)
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 <= -8.2) {
tmp = x;
} else if (z <= 4.8e-49) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.2: tmp = x elif z <= 4.8e-49: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.2) tmp = x; elseif (z <= 4.8e-49) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.2) tmp = x; elseif (z <= 4.8e-49) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.2], x, If[LessEqual[z, 4.8e-49], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-49}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.1999999999999993 or 4.79999999999999985e-49 < z Initial program 79.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 64.6%
if -8.1999999999999993 < z < 4.79999999999999985e-49Initial program 88.5%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 60.4%
associate-/l*68.9%
Simplified68.9%
(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 83.8%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in z around inf 38.2%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (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 / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024136
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))