
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 98.8%
clear-num98.8%
un-div-inv99.0%
Applied egg-rr99.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+160)
(+ x y)
(if (<= z -7.2e-13)
(- x (* t (/ y z)))
(if (<= z 2.6e+33) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+160) {
tmp = x + y;
} else if (z <= -7.2e-13) {
tmp = x - (t * (y / z));
} else if (z <= 2.6e+33) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.2d+160)) then
tmp = x + y
else if (z <= (-7.2d-13)) then
tmp = x - (t * (y / z))
else if (z <= 2.6d+33) then
tmp = x + (y * (t / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+160) {
tmp = x + y;
} else if (z <= -7.2e-13) {
tmp = x - (t * (y / z));
} else if (z <= 2.6e+33) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+160: tmp = x + y elif z <= -7.2e-13: tmp = x - (t * (y / z)) elif z <= 2.6e+33: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+160) tmp = Float64(x + y); elseif (z <= -7.2e-13) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 2.6e+33) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+160) tmp = x + y; elseif (z <= -7.2e-13) tmp = x - (t * (y / z)); elseif (z <= 2.6e+33) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+160], N[(x + y), $MachinePrecision], If[LessEqual[z, -7.2e-13], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+33], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+160}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-13}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+33}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.2000000000000001e160 or 2.5999999999999997e33 < z Initial program 99.9%
Taylor expanded in z around inf 84.6%
+-commutative84.6%
Simplified84.6%
if -5.2000000000000001e160 < z < -7.1999999999999996e-13Initial program 99.9%
Taylor expanded in t around inf 72.9%
mul-1-neg72.9%
associate-/l*86.5%
Simplified86.5%
Taylor expanded in z around inf 70.4%
mul-1-neg70.4%
sub-neg70.4%
associate-/l*75.9%
Simplified75.9%
if -7.1999999999999996e-13 < z < 2.5999999999999997e33Initial program 97.9%
Taylor expanded in z around 0 78.2%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -600000000.0) (not (<= t 8e-75))) (- x (* t (/ y (- z a)))) (+ x (/ y (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -600000000.0) || !(t <= 8e-75)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-600000000.0d0)) .or. (.not. (t <= 8d-75))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y / (1.0d0 - (a / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -600000000.0) || !(t <= 8e-75)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -600000000.0) or not (t <= 8e-75): tmp = x - (t * (y / (z - a))) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -600000000.0) || !(t <= 8e-75)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -600000000.0) || ~((t <= 8e-75))) tmp = x - (t * (y / (z - a))); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -600000000.0], N[Not[LessEqual[t, 8e-75]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -600000000 \lor \neg \left(t \leq 8 \cdot 10^{-75}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if t < -6e8 or 7.9999999999999997e-75 < t Initial program 97.9%
Taylor expanded in t around inf 82.6%
mul-1-neg82.6%
associate-/l*89.5%
Simplified89.5%
if -6e8 < t < 7.9999999999999997e-75Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 81.5%
associate-*l/90.4%
associate-/r/92.8%
div-sub92.7%
*-inverses92.7%
Simplified92.7%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+160) (not (<= z 9.5e+68))) (+ x (/ y (- 1.0 (/ a z)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+160) || !(z <= 9.5e+68)) {
tmp = x + (y / (1.0 - (a / z)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.2d+160)) .or. (.not. (z <= 9.5d+68))) then
tmp = x + (y / (1.0d0 - (a / z)))
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+160) || !(z <= 9.5e+68)) {
tmp = x + (y / (1.0 - (a / z)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+160) or not (z <= 9.5e+68): tmp = x + (y / (1.0 - (a / z))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+160) || !(z <= 9.5e+68)) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+160) || ~((z <= 9.5e+68))) tmp = x + (y / (1.0 - (a / z))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+160], N[Not[LessEqual[z, 9.5e+68]], $MachinePrecision]], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+160} \lor \neg \left(z \leq 9.5 \cdot 10^{+68}\right):\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -5.2000000000000001e160 or 9.50000000000000069e68 < z Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 65.4%
associate-*l/92.1%
associate-/r/95.3%
div-sub95.3%
*-inverses95.3%
Simplified95.3%
if -5.2000000000000001e160 < z < 9.50000000000000069e68Initial program 98.3%
Taylor expanded in t around inf 85.5%
associate-*r/85.5%
mul-1-neg85.5%
distribute-lft-neg-out85.5%
*-commutative85.5%
*-lft-identity85.5%
times-frac88.6%
/-rgt-identity88.6%
distribute-neg-frac88.6%
distribute-neg-frac288.6%
neg-sub088.6%
sub-neg88.6%
+-commutative88.6%
associate--r+88.6%
neg-sub088.6%
remove-double-neg88.6%
Simplified88.6%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e+160) (not (<= z 4.8e+67))) (+ x (* z (/ y (- z a)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+160) || !(z <= 4.8e+67)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.8d+160)) .or. (.not. (z <= 4.8d+67))) then
tmp = x + (z * (y / (z - a)))
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+160) || !(z <= 4.8e+67)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e+160) or not (z <= 4.8e+67): tmp = x + (z * (y / (z - a))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e+160) || !(z <= 4.8e+67)) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.8e+160) || ~((z <= 4.8e+67))) tmp = x + (z * (y / (z - a))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e+160], N[Not[LessEqual[z, 4.8e+67]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+160} \lor \neg \left(z \leq 4.8 \cdot 10^{+67}\right):\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -5.7999999999999998e160 or 4.80000000000000004e67 < z Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 65.4%
associate-*l/92.1%
*-commutative92.1%
Simplified92.1%
if -5.7999999999999998e160 < z < 4.80000000000000004e67Initial program 98.3%
Taylor expanded in t around inf 85.5%
associate-*r/85.5%
mul-1-neg85.5%
distribute-lft-neg-out85.5%
*-commutative85.5%
*-lft-identity85.5%
times-frac88.6%
/-rgt-identity88.6%
distribute-neg-frac88.6%
distribute-neg-frac288.6%
neg-sub088.6%
sub-neg88.6%
+-commutative88.6%
associate--r+88.6%
neg-sub088.6%
remove-double-neg88.6%
Simplified88.6%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e+160) (not (<= z 8.8e+75))) (+ x y) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e+160) || !(z <= 8.8e+75)) {
tmp = x + y;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-6.8d+160)) .or. (.not. (z <= 8.8d+75))) then
tmp = x + y
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e+160) || !(z <= 8.8e+75)) {
tmp = x + y;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e+160) or not (z <= 8.8e+75): tmp = x + y else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.8e+160) || !(z <= 8.8e+75)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.8e+160) || ~((z <= 8.8e+75))) tmp = x + y; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.8e+160], N[Not[LessEqual[z, 8.8e+75]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+160} \lor \neg \left(z \leq 8.8 \cdot 10^{+75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -6.80000000000000061e160 or 8.80000000000000048e75 < z Initial program 99.9%
Taylor expanded in z around inf 87.8%
+-commutative87.8%
Simplified87.8%
if -6.80000000000000061e160 < z < 8.80000000000000048e75Initial program 98.4%
Taylor expanded in t around inf 85.3%
associate-*r/85.3%
mul-1-neg85.3%
distribute-lft-neg-out85.3%
*-commutative85.3%
*-lft-identity85.3%
times-frac88.3%
/-rgt-identity88.3%
distribute-neg-frac88.3%
distribute-neg-frac288.3%
neg-sub088.3%
sub-neg88.3%
+-commutative88.3%
associate--r+88.3%
neg-sub088.3%
remove-double-neg88.3%
Simplified88.3%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+154) (not (<= z 5e+32))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+154) || !(z <= 5e+32)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.75d+154)) .or. (.not. (z <= 5d+32))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+154) || !(z <= 5e+32)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+154) or not (z <= 5e+32): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+154) || !(z <= 5e+32)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e+154) || ~((z <= 5e+32))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+154], N[Not[LessEqual[z, 5e+32]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+154} \lor \neg \left(z \leq 5 \cdot 10^{+32}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.7500000000000001e154 or 4.9999999999999997e32 < z Initial program 99.9%
Taylor expanded in z around inf 84.7%
+-commutative84.7%
Simplified84.7%
if -1.7500000000000001e154 < z < 4.9999999999999997e32Initial program 98.3%
Taylor expanded in z around 0 74.5%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e-55) (not (<= z 3.3e+72))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e-55) || !(z <= 3.3e+72)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.3d-55)) .or. (.not. (z <= 3.3d+72))) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e-55) || !(z <= 3.3e+72)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e-55) or not (z <= 3.3e+72): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e-55) || !(z <= 3.3e+72)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.3e-55) || ~((z <= 3.3e+72))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e-55], N[Not[LessEqual[z, 3.3e+72]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-55} \lor \neg \left(z \leq 3.3 \cdot 10^{+72}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.3000000000000001e-55 or 3.3e72 < z Initial program 99.9%
Taylor expanded in z around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -4.3000000000000001e-55 < z < 3.3e72Initial program 97.9%
Taylor expanded in x around inf 47.5%
Final simplification61.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.75e+173) y (if (<= y 2.7e+222) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.75e+173) {
tmp = y;
} else if (y <= 2.7e+222) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.75d+173)) then
tmp = y
else if (y <= 2.7d+222) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.75e+173) {
tmp = y;
} else if (y <= 2.7e+222) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.75e+173: tmp = y elif y <= 2.7e+222: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.75e+173) tmp = y; elseif (y <= 2.7e+222) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.75e+173) tmp = y; elseif (y <= 2.7e+222) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.75e+173], y, If[LessEqual[y, 2.7e+222], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+173}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+222}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.75e173 or 2.70000000000000013e222 < y Initial program 99.9%
Taylor expanded in z around inf 33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in y around inf 33.3%
if -1.75e173 < y < 2.70000000000000013e222Initial program 98.5%
Taylor expanded in x around inf 61.7%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.8%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.8%
Taylor expanded in x around inf 50.4%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))