
(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 (if (<= z -1e-43) (+ x (* y (/ (- z t) (- z a)))) (+ x (* (- z t) (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-43) {
tmp = x + (y * ((z - t) / (z - a)));
} else {
tmp = x + ((z - t) * (y / (z - 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 <= (-1d-43)) then
tmp = x + (y * ((z - t) / (z - a)))
else
tmp = x + ((z - t) * (y / (z - 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 <= -1e-43) {
tmp = x + (y * ((z - t) / (z - a)));
} else {
tmp = x + ((z - t) * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e-43: tmp = x + (y * ((z - t) / (z - a))) else: tmp = x + ((z - t) * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e-43) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e-43) tmp = x + (y * ((z - t) / (z - a))); else tmp = x + ((z - t) * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e-43], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-43}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -1.00000000000000008e-43Initial program 100.0%
if -1.00000000000000008e-43 < z Initial program 94.2%
Taylor expanded in y around 0 87.5%
*-commutative87.5%
associate-*r/99.4%
Simplified99.4%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- z a))))) (if (<= t_1 3.5e+287) (+ x t_1) (- x (* t (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if (t_1 <= 3.5e+287) {
tmp = x + t_1;
} else {
tmp = x - (t * (y / (z - 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) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (z - a))
if (t_1 <= 3.5d+287) then
tmp = x + t_1
else
tmp = x - (t * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if (t_1 <= 3.5e+287) {
tmp = x + t_1;
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (z - a)) tmp = 0 if t_1 <= 3.5e+287: tmp = x + t_1 else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a))) tmp = 0.0 if (t_1 <= 3.5e+287) tmp = Float64(x + t_1); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (z - a)); tmp = 0.0; if (t_1 <= 3.5e+287) tmp = x + t_1; else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 3.5e+287], N[(x + t$95$1), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 3.5 \cdot 10^{+287}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 3.49999999999999976e287Initial program 97.7%
if 3.49999999999999976e287 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 73.4%
Taylor expanded in t around inf 94.9%
mul-1-neg94.9%
associate-/l*100.0%
Simplified100.0%
Final simplification97.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1550000000.0)
(+ x y)
(if (<= z 9.8e-34)
(+ x (* t (/ y a)))
(if (<= z 9e+178) (- x (/ t (/ z y))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1550000000.0) {
tmp = x + y;
} else if (z <= 9.8e-34) {
tmp = x + (t * (y / a));
} else if (z <= 9e+178) {
tmp = x - (t / (z / y));
} 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 <= (-1550000000.0d0)) then
tmp = x + y
else if (z <= 9.8d-34) then
tmp = x + (t * (y / a))
else if (z <= 9d+178) then
tmp = x - (t / (z / y))
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 <= -1550000000.0) {
tmp = x + y;
} else if (z <= 9.8e-34) {
tmp = x + (t * (y / a));
} else if (z <= 9e+178) {
tmp = x - (t / (z / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1550000000.0: tmp = x + y elif z <= 9.8e-34: tmp = x + (t * (y / a)) elif z <= 9e+178: tmp = x - (t / (z / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1550000000.0) tmp = Float64(x + y); elseif (z <= 9.8e-34) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 9e+178) tmp = Float64(x - Float64(t / Float64(z / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1550000000.0) tmp = x + y; elseif (z <= 9.8e-34) tmp = x + (t * (y / a)); elseif (z <= 9e+178) tmp = x - (t / (z / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1550000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.8e-34], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+178], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1550000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-34}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+178}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.55e9 or 8.9999999999999994e178 < z Initial program 100.0%
Taylor expanded in z around inf 81.2%
if -1.55e9 < z < 9.79999999999999925e-34Initial program 91.0%
Taylor expanded in z around 0 80.0%
associate-/l*81.7%
Simplified81.7%
if 9.79999999999999925e-34 < z < 8.9999999999999994e178Initial program 99.9%
Taylor expanded in t around inf 70.8%
mul-1-neg70.8%
associate-/l*82.6%
Simplified82.6%
clear-num82.5%
un-div-inv82.5%
Applied egg-rr82.5%
Taylor expanded in z around inf 69.8%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5600000000.0)
(+ x y)
(if (<= z 3.2e+74)
(+ x (* t (/ y a)))
(if (<= z 5.4e+177) (- x (* t (/ y z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5600000000.0) {
tmp = x + y;
} else if (z <= 3.2e+74) {
tmp = x + (t * (y / a));
} else if (z <= 5.4e+177) {
tmp = x - (t * (y / z));
} 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 <= (-5600000000.0d0)) then
tmp = x + y
else if (z <= 3.2d+74) then
tmp = x + (t * (y / a))
else if (z <= 5.4d+177) then
tmp = x - (t * (y / z))
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 <= -5600000000.0) {
tmp = x + y;
} else if (z <= 3.2e+74) {
tmp = x + (t * (y / a));
} else if (z <= 5.4e+177) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5600000000.0: tmp = x + y elif z <= 3.2e+74: tmp = x + (t * (y / a)) elif z <= 5.4e+177: tmp = x - (t * (y / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5600000000.0) tmp = Float64(x + y); elseif (z <= 3.2e+74) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 5.4e+177) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5600000000.0) tmp = x + y; elseif (z <= 3.2e+74) tmp = x + (t * (y / a)); elseif (z <= 5.4e+177) tmp = x - (t * (y / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5600000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.2e+74], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+177], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5600000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+74}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+177}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.6e9 or 5.39999999999999982e177 < z Initial program 100.0%
Taylor expanded in z around inf 81.2%
if -5.6e9 < z < 3.19999999999999995e74Initial program 92.5%
Taylor expanded in z around 0 76.6%
associate-/l*78.7%
Simplified78.7%
if 3.19999999999999995e74 < z < 5.39999999999999982e177Initial program 99.9%
associate-*r/77.5%
Simplified77.5%
Taylor expanded in z around 0 65.7%
mul-1-neg65.7%
distribute-lft-neg-out65.7%
*-commutative65.7%
Simplified65.7%
Taylor expanded in z around inf 64.3%
mul-1-neg64.3%
associate-/l*75.4%
distribute-rgt-neg-in75.4%
distribute-neg-frac275.4%
Simplified75.4%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e-11) (not (<= z 5e-27))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e-11) || !(z <= 5e-27)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / 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.7d-11)) .or. (.not. (z <= 5d-27))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (y / 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.7e-11) || !(z <= 5e-27)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e-11) or not (z <= 5e-27): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e-11) || !(z <= 5e-27)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e-11) || ~((z <= 5e-27))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e-11], N[Not[LessEqual[z, 5e-27]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-11} \lor \neg \left(z \leq 5 \cdot 10^{-27}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.6999999999999999e-11 or 5.0000000000000002e-27 < z Initial program 99.9%
Taylor expanded in a around 0 63.1%
associate-/l*85.2%
div-sub85.2%
*-inverses85.2%
Simplified85.2%
if -1.6999999999999999e-11 < z < 5.0000000000000002e-27Initial program 90.8%
Taylor expanded in z around 0 80.6%
associate-/l*82.4%
Simplified82.4%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e+57) (not (<= t 7.8e+57))) (- x (* t (/ y (- z a)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e+57) || !(t <= 7.8e+57)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - 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 ((t <= (-3d+57)) .or. (.not. (t <= 7.8d+57))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e+57) || !(t <= 7.8e+57)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3e+57) or not (t <= 7.8e+57): tmp = x - (t * (y / (z - a))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e+57) || !(t <= 7.8e+57)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3e+57) || ~((t <= 7.8e+57))) tmp = x - (t * (y / (z - a))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e+57], N[Not[LessEqual[t, 7.8e+57]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+57} \lor \neg \left(t \leq 7.8 \cdot 10^{+57}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -3e57 or 7.79999999999999937e57 < t Initial program 92.9%
Taylor expanded in t around inf 78.8%
mul-1-neg78.8%
associate-/l*89.4%
Simplified89.4%
if -3e57 < t < 7.79999999999999937e57Initial program 98.8%
Taylor expanded in t around 0 80.9%
associate-/l*95.6%
Simplified95.6%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -4e-110) (+ x (* y (- 1.0 (/ t z)))) (if (<= t 1.12e+60) (+ x (* y (/ z (- z a)))) (+ x (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e-110) {
tmp = x + (y * (1.0 - (t / z)));
} else if (t <= 1.12e+60) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / 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 (t <= (-4d-110)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (t <= 1.12d+60) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e-110) {
tmp = x + (y * (1.0 - (t / z)));
} else if (t <= 1.12e+60) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e-110: tmp = x + (y * (1.0 - (t / z))) elif t <= 1.12e+60: tmp = x + (y * (z / (z - a))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e-110) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (t <= 1.12e+60) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4e-110) tmp = x + (y * (1.0 - (t / z))); elseif (t <= 1.12e+60) tmp = x + (y * (z / (z - a))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e-110], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+60], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-110}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+60}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.0000000000000002e-110Initial program 94.3%
Taylor expanded in a around 0 65.7%
associate-/l*72.2%
div-sub72.2%
*-inverses72.2%
Simplified72.2%
if -4.0000000000000002e-110 < t < 1.1199999999999999e60Initial program 98.6%
Taylor expanded in t around 0 82.5%
associate-/l*97.4%
Simplified97.4%
if 1.1199999999999999e60 < t Initial program 93.4%
Taylor expanded in z around 0 70.1%
associate-/l*78.1%
Simplified78.1%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -9e+56) (+ x (/ t (/ (- a z) y))) (if (<= t 7.5e+57) (+ x (* y (/ z (- z a)))) (- x (* t (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+56) {
tmp = x + (t / ((a - z) / y));
} else if (t <= 7.5e+57) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (t * (y / (z - 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 (t <= (-9d+56)) then
tmp = x + (t / ((a - z) / y))
else if (t <= 7.5d+57) then
tmp = x + (y * (z / (z - a)))
else
tmp = x - (t * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+56) {
tmp = x + (t / ((a - z) / y));
} else if (t <= 7.5e+57) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9e+56: tmp = x + (t / ((a - z) / y)) elif t <= 7.5e+57: tmp = x + (y * (z / (z - a))) else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9e+56) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); elseif (t <= 7.5e+57) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9e+56) tmp = x + (t / ((a - z) / y)); elseif (t <= 7.5e+57) tmp = x + (y * (z / (z - a))); else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+56], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+57], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+56}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+57}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -9.0000000000000006e56Initial program 92.3%
Taylor expanded in t around inf 76.7%
mul-1-neg76.7%
associate-/l*87.0%
Simplified87.0%
clear-num87.1%
un-div-inv87.0%
Applied egg-rr87.0%
if -9.0000000000000006e56 < t < 7.5000000000000006e57Initial program 98.8%
Taylor expanded in t around 0 80.9%
associate-/l*95.6%
Simplified95.6%
if 7.5000000000000006e57 < t Initial program 93.5%
Taylor expanded in t around inf 81.0%
mul-1-neg81.0%
associate-/l*91.9%
Simplified91.9%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3250000000.0) (not (<= z 1.72e+75))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3250000000.0) || !(z <= 1.72e+75)) {
tmp = x + y;
} else {
tmp = x + (t * (y / 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 <= (-3250000000.0d0)) .or. (.not. (z <= 1.72d+75))) then
tmp = x + y
else
tmp = x + (t * (y / 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 <= -3250000000.0) || !(z <= 1.72e+75)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3250000000.0) or not (z <= 1.72e+75): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3250000000.0) || !(z <= 1.72e+75)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3250000000.0) || ~((z <= 1.72e+75))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3250000000.0], N[Not[LessEqual[z, 1.72e+75]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3250000000 \lor \neg \left(z \leq 1.72 \cdot 10^{+75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.25e9 or 1.72e75 < z Initial program 99.9%
Taylor expanded in z around inf 76.3%
if -3.25e9 < z < 1.72e75Initial program 92.5%
Taylor expanded in z around 0 76.6%
associate-/l*78.7%
Simplified78.7%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-8) (not (<= z 1.9e+84))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-8) || !(z <= 1.9e+84)) {
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 <= (-2.7d-8)) .or. (.not. (z <= 1.9d+84))) 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 <= -2.7e-8) || !(z <= 1.9e+84)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-8) or not (z <= 1.9e+84): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-8) || !(z <= 1.9e+84)) 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 <= -2.7e-8) || ~((z <= 1.9e+84))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-8], N[Not[LessEqual[z, 1.9e+84]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-8} \lor \neg \left(z \leq 1.9 \cdot 10^{+84}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.70000000000000002e-8 or 1.9e84 < z Initial program 99.9%
Taylor expanded in z around inf 75.9%
if -2.70000000000000002e-8 < z < 1.9e84Initial program 92.4%
Taylor expanded in t around 0 66.2%
Taylor expanded in x around inf 59.3%
Final simplification67.2%
(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 96.0%
Taylor expanded in t around 0 63.2%
Taylor expanded in x around inf 53.0%
Final simplification53.0%
(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 2024073
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))