
(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 9 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 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 99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- z a) (- t))))))
(if (<= z -4.8e+57)
(+ x (* (- z t) (/ y z)))
(if (<= z 4.2e-73)
t_1
(if (<= z 6.5e+51)
(+ x (/ (* y z) (- z a)))
(if (<= z 2.6e+98) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((z - a) / -t));
double tmp;
if (z <= -4.8e+57) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 4.2e-73) {
tmp = t_1;
} else if (z <= 6.5e+51) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 2.6e+98) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y / ((z - a) / -t))
if (z <= (-4.8d+57)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 4.2d-73) then
tmp = t_1
else if (z <= 6.5d+51) then
tmp = x + ((y * z) / (z - a))
else if (z <= 2.6d+98) then
tmp = t_1
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 t_1 = x + (y / ((z - a) / -t));
double tmp;
if (z <= -4.8e+57) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 4.2e-73) {
tmp = t_1;
} else if (z <= 6.5e+51) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 2.6e+98) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((z - a) / -t)) tmp = 0 if z <= -4.8e+57: tmp = x + ((z - t) * (y / z)) elif z <= 4.2e-73: tmp = t_1 elif z <= 6.5e+51: tmp = x + ((y * z) / (z - a)) elif z <= 2.6e+98: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(-t)))) tmp = 0.0 if (z <= -4.8e+57) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 4.2e-73) tmp = t_1; elseif (z <= 6.5e+51) tmp = Float64(x + Float64(Float64(y * z) / Float64(z - a))); elseif (z <= 2.6e+98) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((z - a) / -t)); tmp = 0.0; if (z <= -4.8e+57) tmp = x + ((z - t) * (y / z)); elseif (z <= 4.2e-73) tmp = t_1; elseif (z <= 6.5e+51) tmp = x + ((y * z) / (z - a)); elseif (z <= 2.6e+98) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+57], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e-73], t$95$1, If[LessEqual[z, 6.5e+51], N[(x + N[(N[(y * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+98], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z - a}{-t}}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+57}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+51}:\\
\;\;\;\;x + \frac{y \cdot z}{z - a}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.80000000000000009e57Initial program 100.0%
Taylor expanded in a around 0 58.1%
+-commutative58.1%
associate-/l*92.2%
associate-/r/89.4%
Simplified89.4%
if -4.80000000000000009e57 < z < 4.1999999999999997e-73 or 6.5e51 < z < 2.6e98Initial program 99.2%
Taylor expanded in t around inf 90.9%
associate-*r/90.9%
mul-1-neg90.9%
distribute-lft-neg-out90.9%
*-commutative90.9%
associate-/l*93.7%
Simplified93.7%
if 4.1999999999999997e-73 < z < 6.5e51Initial program 96.2%
Taylor expanded in t around 0 89.6%
if 2.6e98 < z Initial program 100.0%
Taylor expanded in z around inf 94.2%
+-commutative94.2%
Simplified94.2%
Final simplification92.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.8e+100)
(+ x y)
(if (<= z -1.3e-82)
(- x (* t (/ y z)))
(if (<= z 1.9e-73) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+100) {
tmp = x + y;
} else if (z <= -1.3e-82) {
tmp = x - (t * (y / z));
} else if (z <= 1.9e-73) {
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.8d+100)) then
tmp = x + y
else if (z <= (-1.3d-82)) then
tmp = x - (t * (y / z))
else if (z <= 1.9d-73) 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.8e+100) {
tmp = x + y;
} else if (z <= -1.3e-82) {
tmp = x - (t * (y / z));
} else if (z <= 1.9e-73) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e+100: tmp = x + y elif z <= -1.3e-82: tmp = x - (t * (y / z)) elif z <= 1.9e-73: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+100) tmp = Float64(x + y); elseif (z <= -1.3e-82) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.9e-73) 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.8e+100) tmp = x + y; elseif (z <= -1.3e-82) tmp = x - (t * (y / z)); elseif (z <= 1.9e-73) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+100], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.3e-82], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-73], 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.8 \cdot 10^{+100}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-82}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-73}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.8000000000000001e100 or 1.9000000000000001e-73 < z Initial program 99.1%
Taylor expanded in z around inf 84.4%
+-commutative84.4%
Simplified84.4%
if -5.8000000000000001e100 < z < -1.3e-82Initial program 99.9%
Taylor expanded in t around inf 78.7%
associate-*r/78.7%
mul-1-neg78.7%
distribute-lft-neg-out78.7%
*-commutative78.7%
associate-/l*85.7%
Simplified85.7%
Taylor expanded in z around inf 76.3%
associate-*r/76.3%
*-commutative76.3%
neg-mul-176.3%
distribute-lft-neg-in76.3%
associate-/l*78.6%
Simplified78.6%
Taylor expanded in x around 0 76.3%
metadata-eval76.3%
associate-*l/78.6%
*-commutative78.6%
cancel-sign-sub-inv78.6%
*-lft-identity78.6%
*-commutative78.6%
associate-*l/76.3%
associate-*r/78.6%
Simplified78.6%
if -1.3e-82 < z < 1.9000000000000001e-73Initial program 98.9%
Taylor expanded in z around 0 84.1%
+-commutative84.1%
associate-/l*81.5%
associate-/r/84.4%
Simplified84.4%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e-87) (+ x (* (- z t) (/ y z))) (if (<= z 1.7e-74) (+ x (* (/ y a) (- t z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-87) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 1.7e-74) {
tmp = x + ((y / a) * (t - 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 <= (-8d-87)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 1.7d-74) then
tmp = x + ((y / a) * (t - 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 <= -8e-87) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 1.7e-74) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e-87: tmp = x + ((z - t) * (y / z)) elif z <= 1.7e-74: tmp = x + ((y / a) * (t - z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e-87) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 1.7e-74) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e-87) tmp = x + ((z - t) * (y / z)); elseif (z <= 1.7e-74) tmp = x + ((y / a) * (t - z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e-87], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-74], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-87}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-74}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.00000000000000014e-87Initial program 99.9%
Taylor expanded in a around 0 63.9%
+-commutative63.9%
associate-/l*88.2%
associate-/r/86.1%
Simplified86.1%
if -8.00000000000000014e-87 < z < 1.7e-74Initial program 98.9%
Taylor expanded in a around inf 86.6%
mul-1-neg86.6%
unsub-neg86.6%
associate-/l*85.9%
associate-/r/84.8%
Simplified84.8%
if 1.7e-74 < z Initial program 98.5%
Taylor expanded in z around inf 83.3%
+-commutative83.3%
Simplified83.3%
Final simplification84.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-20) (not (<= z 7.5e-76))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-20) || !(z <= 7.5e-76)) {
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 <= (-7.2d-20)) .or. (.not. (z <= 7.5d-76))) 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 <= -7.2e-20) || !(z <= 7.5e-76)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-20) or not (z <= 7.5e-76): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-20) || !(z <= 7.5e-76)) 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 <= -7.2e-20) || ~((z <= 7.5e-76))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e-20], N[Not[LessEqual[z, 7.5e-76]], $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 -7.2 \cdot 10^{-20} \lor \neg \left(z \leq 7.5 \cdot 10^{-76}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -7.19999999999999948e-20 or 7.4999999999999997e-76 < z Initial program 99.3%
Taylor expanded in z around inf 78.6%
+-commutative78.6%
Simplified78.6%
if -7.19999999999999948e-20 < z < 7.4999999999999997e-76Initial program 99.0%
Taylor expanded in z around 0 79.9%
+-commutative79.9%
associate-/l*79.3%
associate-/r/82.0%
Simplified82.0%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.8e-82) (+ x (* (- z t) (/ y z))) (if (<= z 4.2e-73) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e-82) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 4.2e-73) {
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 <= (-1.8d-82)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 4.2d-73) 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 <= -1.8e-82) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 4.2e-73) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e-82: tmp = x + ((z - t) * (y / z)) elif z <= 4.2e-73: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e-82) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 4.2e-73) 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 <= -1.8e-82) tmp = x + ((z - t) * (y / z)); elseif (z <= 4.2e-73) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e-82], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e-73], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-82}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-73}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.79999999999999999e-82Initial program 99.9%
Taylor expanded in a around 0 63.9%
+-commutative63.9%
associate-/l*88.2%
associate-/r/86.1%
Simplified86.1%
if -1.79999999999999999e-82 < z < 4.1999999999999997e-73Initial program 98.9%
Taylor expanded in z around 0 84.1%
+-commutative84.1%
associate-/l*81.5%
associate-/r/84.4%
Simplified84.4%
if 4.1999999999999997e-73 < z Initial program 98.5%
Taylor expanded in z around inf 83.3%
+-commutative83.3%
Simplified83.3%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+55) (not (<= z 3e-73))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+55) || !(z <= 3e-73)) {
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 <= (-8.2d+55)) .or. (.not. (z <= 3d-73))) 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 <= -8.2e+55) || !(z <= 3e-73)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e+55) or not (z <= 3e-73): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+55) || !(z <= 3e-73)) 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 <= -8.2e+55) || ~((z <= 3e-73))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+55], N[Not[LessEqual[z, 3e-73]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+55} \lor \neg \left(z \leq 3 \cdot 10^{-73}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.19999999999999962e55 or 3e-73 < z Initial program 99.2%
Taylor expanded in z around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -8.19999999999999962e55 < z < 3e-73Initial program 99.1%
Taylor expanded in x around inf 59.7%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.1e+195) (+ x y) (* y (- 1.0 (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.1e+195) {
tmp = x + y;
} else {
tmp = y * (1.0 - (t / 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 <= 4.1d+195) then
tmp = x + y
else
tmp = y * (1.0d0 - (t / 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 <= 4.1e+195) {
tmp = x + y;
} else {
tmp = y * (1.0 - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.1e+195: tmp = x + y else: tmp = y * (1.0 - (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.1e+195) tmp = Float64(x + y); else tmp = Float64(y * Float64(1.0 - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4.1e+195) tmp = x + y; else tmp = y * (1.0 - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.1e+195], N[(x + y), $MachinePrecision], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.1 \cdot 10^{+195}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if t < 4.1e195Initial program 99.1%
Taylor expanded in z around inf 69.8%
+-commutative69.8%
Simplified69.8%
if 4.1e195 < t Initial program 99.9%
Taylor expanded in a around 0 67.8%
+-commutative67.8%
associate-/l*81.2%
associate-/r/81.1%
Simplified81.1%
Taylor expanded in y around inf 72.0%
Final simplification70.0%
(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 99.2%
Taylor expanded in x around inf 57.5%
Final simplification57.5%
(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 2024018
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))