
(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 9 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 80.0%
associate-/l*97.3%
Simplified97.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.2e+29) (not (<= z 2e+33))) (* x (- 1.0 (/ y z))) (* y (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.2e+29) || !(z <= 2e+33)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y * (x / (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-5.2d+29)) .or. (.not. (z <= 2d+33))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = y * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.2e+29) || !(z <= 2e+33)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.2e+29) or not (z <= 2e+33): tmp = x * (1.0 - (y / z)) else: tmp = y * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.2e+29) || !(z <= 2e+33)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(y * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.2e+29) || ~((z <= 2e+33))) tmp = x * (1.0 - (y / z)); else tmp = y * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.2e+29], N[Not[LessEqual[z, 2e+33]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+29} \lor \neg \left(z \leq 2 \cdot 10^{+33}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -5.2e29 or 1.9999999999999999e33 < z Initial program 71.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 58.8%
mul-1-neg58.8%
associate-/l*82.7%
distribute-rgt-neg-in82.7%
distribute-frac-neg82.7%
sub-neg82.7%
distribute-neg-in82.7%
remove-double-neg82.7%
+-commutative82.7%
sub-neg82.7%
div-sub82.7%
*-inverses82.7%
Simplified82.7%
if -5.2e29 < z < 1.9999999999999999e33Initial program 89.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around 0 89.0%
*-rgt-identity89.0%
times-frac94.8%
/-rgt-identity94.8%
associate-/r/93.8%
Simplified93.8%
Taylor expanded in y around inf 74.0%
associate-*l/79.4%
*-commutative79.4%
Simplified79.4%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.8e+29) (not (<= z 2.65e+34))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+29) || !(z <= 2.65e+34)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.8d+29)) .or. (.not. (z <= 2.65d+34))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+29) || !(z <= 2.65e+34)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.8e+29) or not (z <= 2.65e+34): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.8e+29) || !(z <= 2.65e+34)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.8e+29) || ~((z <= 2.65e+34))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.8e+29], N[Not[LessEqual[z, 2.65e+34]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+29} \lor \neg \left(z \leq 2.65 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -4.8000000000000002e29 or 2.6500000000000002e34 < z Initial program 71.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 58.8%
mul-1-neg58.8%
associate-/l*82.7%
distribute-rgt-neg-in82.7%
distribute-frac-neg82.7%
sub-neg82.7%
distribute-neg-in82.7%
remove-double-neg82.7%
+-commutative82.7%
sub-neg82.7%
div-sub82.7%
*-inverses82.7%
Simplified82.7%
if -4.8000000000000002e29 < z < 2.6500000000000002e34Initial program 89.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around inf 74.0%
associate-/l*76.4%
Simplified76.4%
Final simplification79.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.2e-16) (not (<= z 1.65e-66))) (* x (- 1.0 (/ y z))) (/ y (/ t x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e-16) || !(z <= 1.65e-66)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y / (t / 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 <= (-2.2d-16)) .or. (.not. (z <= 1.65d-66))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = y / (t / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e-16) || !(z <= 1.65e-66)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y / (t / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.2e-16) or not (z <= 1.65e-66): tmp = x * (1.0 - (y / z)) else: tmp = y / (t / x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e-16) || !(z <= 1.65e-66)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(y / Float64(t / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.2e-16) || ~((z <= 1.65e-66))) tmp = x * (1.0 - (y / z)); else tmp = y / (t / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.2e-16], N[Not[LessEqual[z, 1.65e-66]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-16} \lor \neg \left(z \leq 1.65 \cdot 10^{-66}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\end{array}
\end{array}
if z < -2.2e-16 or 1.6499999999999999e-66 < z Initial program 74.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 55.8%
mul-1-neg55.8%
associate-/l*76.6%
distribute-rgt-neg-in76.6%
distribute-frac-neg76.6%
sub-neg76.6%
distribute-neg-in76.6%
remove-double-neg76.6%
+-commutative76.6%
sub-neg76.6%
div-sub76.6%
*-inverses76.6%
Simplified76.6%
if -2.2e-16 < z < 1.6499999999999999e-66Initial program 89.2%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in x around 0 89.2%
*-rgt-identity89.2%
times-frac94.9%
/-rgt-identity94.9%
associate-/r/92.3%
Simplified92.3%
Taylor expanded in y around inf 79.0%
associate-*l/84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in t around inf 74.1%
clear-num74.1%
un-div-inv74.2%
Applied egg-rr74.2%
Final simplification75.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.25e-12) (/ x (/ (- z t) z)) (if (<= z 2.05e+33) (* y (/ x (- t z))) (* x (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e-12) {
tmp = x / ((z - t) / z);
} else if (z <= 2.05e+33) {
tmp = y * (x / (t - z));
} else {
tmp = x * (1.0 - (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 (z <= (-1.25d-12)) then
tmp = x / ((z - t) / z)
else if (z <= 2.05d+33) then
tmp = y * (x / (t - z))
else
tmp = x * (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e-12) {
tmp = x / ((z - t) / z);
} else if (z <= 2.05e+33) {
tmp = y * (x / (t - z));
} else {
tmp = x * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.25e-12: tmp = x / ((z - t) / z) elif z <= 2.05e+33: tmp = y * (x / (t - z)) else: tmp = x * (1.0 - (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.25e-12) tmp = Float64(x / Float64(Float64(z - t) / z)); elseif (z <= 2.05e+33) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = Float64(x * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.25e-12) tmp = x / ((z - t) / z); elseif (z <= 2.05e+33) tmp = y * (x / (t - z)); else tmp = x * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e-12], N[(x / N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e+33], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{\frac{z - t}{z}}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+33}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -1.24999999999999992e-12Initial program 78.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 78.7%
*-rgt-identity78.7%
times-frac82.5%
/-rgt-identity82.5%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 83.8%
neg-mul-183.8%
Simplified83.8%
if -1.24999999999999992e-12 < z < 2.04999999999999997e33Initial program 89.2%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in x around 0 89.2%
*-rgt-identity89.2%
times-frac94.9%
/-rgt-identity94.9%
associate-/r/93.5%
Simplified93.5%
Taylor expanded in y around inf 75.4%
associate-*l/81.2%
*-commutative81.2%
Simplified81.2%
if 2.04999999999999997e33 < z Initial program 66.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 56.3%
mul-1-neg56.3%
associate-/l*84.7%
distribute-rgt-neg-in84.7%
distribute-frac-neg84.7%
sub-neg84.7%
distribute-neg-in84.7%
remove-double-neg84.7%
+-commutative84.7%
sub-neg84.7%
div-sub84.7%
*-inverses84.7%
Simplified84.7%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (<= z -5.3e+29) x (if (<= z 9.8e+33) (/ y (/ t x)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.3e+29) {
tmp = x;
} else if (z <= 9.8e+33) {
tmp = y / (t / x);
} 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 <= (-5.3d+29)) then
tmp = x
else if (z <= 9.8d+33) then
tmp = y / (t / x)
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 <= -5.3e+29) {
tmp = x;
} else if (z <= 9.8e+33) {
tmp = y / (t / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.3e+29: tmp = x elif z <= 9.8e+33: tmp = y / (t / x) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.3e+29) tmp = x; elseif (z <= 9.8e+33) tmp = Float64(y / Float64(t / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.3e+29) tmp = x; elseif (z <= 9.8e+33) tmp = y / (t / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.3e+29], x, If[LessEqual[z, 9.8e+33], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.3e29 or 9.80000000000000027e33 < z Initial program 71.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 68.2%
if -5.3e29 < z < 9.80000000000000027e33Initial program 89.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around 0 89.0%
*-rgt-identity89.0%
times-frac94.8%
/-rgt-identity94.8%
associate-/r/93.8%
Simplified93.8%
Taylor expanded in y around inf 74.0%
associate-*l/79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in t around inf 65.4%
clear-num65.3%
un-div-inv65.4%
Applied egg-rr65.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5.1e+29) x (if (<= z 1.5e+35) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.1e+29) {
tmp = x;
} else if (z <= 1.5e+35) {
tmp = y * (x / 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 <= (-5.1d+29)) then
tmp = x
else if (z <= 1.5d+35) then
tmp = y * (x / 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 <= -5.1e+29) {
tmp = x;
} else if (z <= 1.5e+35) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.1e+29: tmp = x elif z <= 1.5e+35: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.1e+29) tmp = x; elseif (z <= 1.5e+35) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.1e+29) tmp = x; elseif (z <= 1.5e+35) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.1e+29], x, If[LessEqual[z, 1.5e+35], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+35}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.1000000000000001e29 or 1.49999999999999995e35 < z Initial program 71.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 68.2%
if -5.1000000000000001e29 < z < 1.49999999999999995e35Initial program 89.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around 0 89.0%
*-rgt-identity89.0%
times-frac94.8%
/-rgt-identity94.8%
associate-/r/93.8%
Simplified93.8%
Taylor expanded in y around inf 74.0%
associate-*l/79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in t around inf 65.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5e+29) x (if (<= z 4.8e+34) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+29) {
tmp = x;
} else if (z <= 4.8e+34) {
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 <= (-5d+29)) then
tmp = x
else if (z <= 4.8d+34) 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 <= -5e+29) {
tmp = x;
} else if (z <= 4.8e+34) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5e+29: tmp = x elif z <= 4.8e+34: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5e+29) tmp = x; elseif (z <= 4.8e+34) 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 <= -5e+29) tmp = x; elseif (z <= 4.8e+34) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e+29], x, If[LessEqual[z, 4.8e+34], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.0000000000000001e29 or 4.79999999999999974e34 < z Initial program 71.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 68.2%
if -5.0000000000000001e29 < z < 4.79999999999999974e34Initial program 89.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in z around 0 60.1%
associate-/l*64.5%
Simplified64.5%
(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 80.0%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in z around inf 41.1%
(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 2024163
(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)))